Before asking an AI tool to change an application, establish which files you started with, where you can safely work and what already behaves as expected. Otherwise a later failure has several plausible causes: the requested change, a different starter, an incomplete installation or the wrong database. A green command without that context is difficult to interpret.
In this lesson you will create your own local booking workbench, verify its source identity, run its existing behaviour and save an evidence record. You will also demonstrate that two bad materialization attempts leave your first copy and an unrelated edit intact. No AI account, model download, API credit or cloud resource is needed here.
Automated browser profile
Later browser exercises use the installed Chrome156 family with the pinned Playwright1.64.1 driver. Record the full browser version from each actual run. Historical receipts retain their original patch versions; they are not the identity of your current browser. The exercise gate checks the major family, and its behavior assertions must still run on your actual patch. Another major version or operating system needs a separately checked setup. A version match alone establishes no application behavior or accessibility conformance.
What you are starting with
The practice application has synthetic members, equipment and fixed morning / afternoon slot IDs. Its browser page calls a small JSON API, which stores bookings in a local SQLite file. Listing and creation work. Cancellation is a safe incomplete feature: its policy helper currently denies every cancellation. Its label helper returns the deliberately unhelpful word “Booking”. Leave those helpers alone; later lessons define independent acceptance cases and make the real AI-assisted change.
The member selector is a test principal: a supplied identity input used to exercise a decision. Anyone using this local app can select another member. It is not a login, tamper-resistant session or production authentication system. Use only the supplied synthetic data.
Use a user-owned practice directory outside any existing repository. You need a terminal/editor, basic Git status/diff/commit knowledge and a modern browser. The executed reference profile is macOS 15.7.9 arm64, Node 24.19.0, pnpm 11.25.0, CPython 3.12.14 and Git 2.47.0. The materializer requires CPython 3.12 and POSIX no-follow filesystem operations. Other hosts have not been verified. Do not weaken its guards or silently replace an existing installation if your environment differs.
In your terminal, check:
node --version
pnpm --version
python3.12 --version
git --version
The first two must match the pinned profile. Record the actual Python/Git versions; the materializer checks the Python 3.12 line. If a command is missing, obtain the tool through its official distribution or your IT-approved setup, then recheck. Node’s pinned distribution, pnpm’s installation guide and Python’s distribution are starting points; installing tools is a separate action from running the supplied workbench. Select the exact pinned versions when following installer guidance; an unversioned “latest” command does not reproduce this profile.
The application uses TypeScript 6.0.3, @types/node 24.10.0 and Playwright
1.64.1 as locked development dependencies. The browser-driver package is installed
for later lessons; this lesson’s manual UI observation uses your existing browser.
Node’s pinned SQLite API is a release candidate, not a production-support
promise. See the versioned Node reference.
You do not need to understand TypeScript or SQL internals yet; the next bridge
lessons explain them before you change those boundaries.
Verify identity before executing the payload
Download booking-workbench.zip from this lesson’s Practice files panel. Expand its SHA-256 checksum entry. SHA-256 is a digest calculated from bytes: a different digest means a different byte sequence for this comparison. A match tells you the file matches the stated expected identity; it does not establish that a supplier or its code is trustworthy.
From the directory containing the downloaded ZIP, run:
shasum -a 256 booking-workbench.zip
Compare the full 64 hexadecimal characters with the current course panel. Do not obtain the expected archive hash from inside the same untrusted ZIP. If they differ, stop and download/check again; do not edit the expected value to make the comparison pass. A course update may legitimately have a new identity.
After the match, extract the archive with your usual archive tool. Its top
folder is booking-workbench. Inspect README.md, native-files.json and
materialize.py before running the script.
The archive transports native TypeScript/browser files as readable .tmpl
text. Materialization copies verified bytes to their declared native names;
it does not compile TypeScript or execute the copied code. The existing course
file mechanism uses this text transport. Your working copy will contain ordinary
.ts, .mjs, .js, .html and .css files.
For example, this is the actual manifest entry for the lesson-1 policy helper:
{
"source": "templates/src/policy.ts.tmpl",
"target": "src/policy.ts",
"bytes": 301,
"sha256": "faca954b34107316b889bb17db7ca86189fd80c8128eefa639260d13e8bb2113"
}
source names a file inside the extracted payload; target names its relative
native output. bytes counts UTF-8 bytes, including comments and newlines.
sha256 covers the complete file, not just its function body. Appending a comment
changes the bytes even when the program’s behaviour appears unchanged.
The materializer reads and verifies the entire declared payload before creating
the destination. It rejects unexpected files, hash/size mismatches, duplicate or
escaping output paths, symlinks and an existing destination. It uses exclusive
file creation and writes .workbench-origin.json last. That marker records
the manifest identity and completed native-file count. A retained partial folder
without the matching marker must not be treated as a successful setup.
These are integrity and overwrite guards. They are not publisher authentication, an OS sandbox or protection against a hostile same-user process racing filesystem changes. Python’s filesystem reference describes the underlying no-follow/exclusive operations and their platform limits.
Create a separate native working copy
The following examples use ~/vibe-practice as an owned parent and
booking-baseline as a new, absent destination. Even an existing empty
booking-baseline is refused. Keep a used target and choose another new name.
From your terminal, create only the parent, then enter the extracted payload. Adjust the second path if your archive tool used a different location:
mkdir -p "$HOME/vibe-practice"
cd "$HOME/Downloads/booking-workbench"
VIBE_PAYLOAD="$(pwd -P)"
VIBE_PARENT="$(cd "$HOME/vibe-practice" && pwd -P)"
VIBE_NATIVE="$VIBE_PARENT/booking-baseline"
python3.12 "$VIBE_PAYLOAD/materialize.py" "$VIBE_NATIVE"
python3.12 "$VIBE_PAYLOAD/materialize.py" --verify "$VIBE_NATIVE"
pwd -P obtains physical paths. The script refuses symlink components, including
system aliases such as /tmp; use the physical owned path rather than bypassing
the check. The variables identify the input payload, owned parent and
native workbench separately. Keep them distinct. The script does not install
packages, initialise Git, start a listener or contact a model/network endpoint.
The first command should report "result": "materialized"; the second reports
"result": "verified-listed-native-files". Record the returned manifest SHA-256.
The original lesson-1 payload produced 22 native files, plus its completion
marker. Later lesson helpers increase the current download’s count. Record the
actual count and manifest identity it reports; paths/digests change with a
different payload. Keep an earlier working copy when obtaining a new snapshot.
--verify checks the listed native files and marker. It does not inventory
extra runtime files, certify dependency behaviour or approve later edits. After
intentional source/readiness changes, a mismatch is expected; inspect Git diff
rather than rewriting the original manifest.
| Native location | What it supplies now |
|---|---|
src/ | Typed booking contracts, database store, HTTP boundary and the two incomplete helpers |
public/ | A plain browser interface; no UI framework or external service |
seeds/baseline.json | Two synthetic bookings in schema v1; no purpose column |
checks/baseline.test.mjs | Independent smoke cases for existing behaviour |
tools/ | Named-database seed/start commands with owned-path checks |
records/, contracts/ | Blank evidence inputs and their interpretation |
Install the locked dependencies and check existing behaviour
Move into the native workbench, then install and check it:
cd "$VIBE_NATIVE"
pnpm install --frozen-lockfile --ignore-scripts --store-dir .pnpm-store
pnpm run typecheck
pnpm run build
pnpm run check
Installation contacts the package registry and writes this project’s
node_modules and named local .pnpm-store. It does not download a model or
browser binary. --frozen-lockfile refuses a required lockfile update rather than
silently changing the resolved dependency set. --ignore-scripts disables
package installation scripts; it is not a sandbox for code you later choose to
run. These flags and effects are described in the pnpm install reference.
Do not remove the frozen flag as a routine fix for a mismatch.
The package scripts are small and inspectable in package.json:
{
"typecheck": "tsc -p tsconfig.json --noEmit",
"build": "tsc -p tsconfig.json",
"check": "node --test checks/baseline.test.mjs"
}
This is an excerpt, not a replacement package.json. typecheck checks the
TypeScript project without emitting JavaScript. build writes its checked
JavaScript into dist; noEmitOnError: true in the supplied configuration stops
new emission on reported errors. It does not erase an old dist, so stop after
a failed build rather than running old output. The TypeScript option reference
explains that condition. check executes the emitted application against the
supplied native tests. Each test owns its temporary database and ephemeral
loopback listener, closes them and removes only that temporary test state.
The current baseline has 12 passing native/API smoke tests. They check the known seed, member-filtered listing, valid creation surviving database reopen, duplicate-slot rejection, invalid inputs, denied other-member cancellation, fixed static-file exposure and refused existing/missing database operations. The Node test runner executes those authored cases; it does not invent the expected behaviour.
These cases cover existing functionality. They do not require successful owner cancellation yet. New cancellation acceptance cases will deliberately fail before the later AI edit. Do not “fix setup” by implementing that future feature or weakening a check. A passing baseline is evidence for these disclosed cases, not complete security, accessibility or production readiness.
Save a source checkpoint in the exercise repository
A working tree is the files you are editing. Git’s index is the selected snapshot for the next commit. A commit records that selected snapshot in local history. A commit does not capture every file on disk, and an ignore rule is not a permission boundary.
First check pwd -P and run git rev-parse --show-toplevel from the native folder.
Before initialisation, the latter should say it is not a repository. If it finds
an existing parent repository, stop and choose a practice location outside it.
Run this block only in your new native workbench, never in a shared course
checkout or the extracted payload:
git init --initial-branch=main
git add .gitignore .workbench-origin.json README.md package.json pnpm-lock.yaml tsconfig.json src public checks tools seeds records contracts
git -c core.hooksPath=/dev/null -c commit.gpgSign=false -c user.name="Practice Learner" -c user.email="learner@example.invalid" commit -m "Record booking baseline"
git rev-parse HEAD
git status --short
This creates a new exercise repository and its initial main; it does not
change another repository’s branch. The -c settings apply only to this practice
commit: use a synthetic local identity, avoid requiring a signing key, and skip
custom hooks. They do not alter your global Git settings. Nothing is pushed or
sent. The Git command reference explains per-command
configuration; Git status describes the two
status columns.
Record the actual HEAD identifier. Status should now be empty for this initial
snapshot. The supplied ignore file leaves dependencies, build output, local
store and data/ untracked. This commit is not a database backup. Retain the
owned database; the consistent-backup lesson comes before migration practice.
Observe a real create, reload and rejection
Still in the native folder, create a new named database and start the app:
node tools/seed.mjs baseline.sqlite
node tools/start.mjs baseline.sqlite 4173
The seed command creates data/baseline.sqlite exclusively and inserts the
supplied synthetic rows. It refuses an existing target, including an old partial
file. Choose another new name, such as baseline-02.sqlite, if needed; do not
delete your current data to make setup appear fresh.
The start command opens that existing file and binds only 127.0.0.1.
Read its actual URL, PID and database path. If port 4173 is occupied, keep the
other service and choose another unused port, or pass 0 and read the assigned
URL. Do not kill an unfamiliar process. Listener behaviour uses the
versioned Node HTTP API.
Open the reported URL in your browser. On a freshly seeded database:
- Keep Practice member A selected. Its one seeded booking uses the drill’s morning slot.
- Select Cordless drill and Afternoon slot, then Create booking. Observe saved feedback and a second booking.
- Reload. The second booking remains; the page re-reads stored state.
- Try the same equipment/slot again. Observe the conflict message and unchanged two rows. The rejected request must not replace the first booking.
Record your browser/version and observations. Disabled cancellation buttons and “Booking” labels are expected here. This is a creation/reload/conflict smoke observation, not the later full UI-state, keyboard or accessibility evaluation. Stop this app with Ctrl-C in its own terminal. Its stop message confirms the owned listener closed; source and database remain for later lessons.
Independent task: make the guards earn their keep
Before reading the hints, attempt both cases in separate disposable locations:
- Copy the extracted payload under a new name, append a comment to
templates/src/policy.ts.tmpland leave its manifest unchanged. Try to materialize into a new absent target. What should happen, and should that destination be created? - Create a separate destination containing
unrelated.txtwith a sentence you want to preserve. Try to materialize there. Confirm the sentence is unchanged and the original native workbench still verifies before you edit its readiness record.
Keep the original payload and workbench unchanged. A refused command is the expected successful observation for these cases. Record the refusal, exit code, protected bytes and reason; do not mark it as an unexplained setup failure.
Hints
First identify which guard each case should reach. Content mismatch is detected while reading input, before destination creation. An existing destination is refused at exclusive directory creation; “empty” does not make it eligible.
Use a new copy name. shutil.copytree below refuses an existing copy target,
avoiding an accidental merge into another directory. Do not alter the hash to
accept your tampered payload.
Worked answers
One complete tamper-case method, from the terminal that still has VIBE_PAYLOAD
and VIBE_PARENT set, is:
python3.12 - "$VIBE_PAYLOAD" "$VIBE_PARENT/payload-tamper" <<'PYCODE'
from pathlib import Path
from shutil import copytree
import sys
source, target = map(Path, sys.argv[1:])
copytree(source, target)
helper = target / "templates/src/policy.ts.tmpl"
with helper.open("a", encoding="utf-8") as stream:
stream.write("\n// independent integrity check\n")
PYCODE
python3.12 "$VIBE_PARENT/payload-tamper/materialize.py" "$VIBE_PARENT/should-stay-absent"
The Python arguments name the original and a new copy. copytree creates only
that new copy; append mode changes only its helper. The materializer should
report a payload hash/size mismatch and exit nonzero. should-stay-absent should
remain absent because input checks precede output creation. A harmless comment
still changes identity. Recalculating its manifest would test a different claim,
not prove that this copy matches the original course payload.
For the unrelated-edit case, this creates a new directory and file; it refuses an already used directory rather than overwriting one:
python3.12 - "$VIBE_PARENT/keep-my-edit" <<'PYCODE'
from pathlib import Path
import sys
target = Path(sys.argv[1])
target.mkdir()
with (target / "unrelated.txt").open("x", encoding="utf-8") as stream:
stream.write("keep this learner edit\n")
PYCODE
python3.12 "$VIBE_PAYLOAD/materialize.py" "$VIBE_PARENT/keep-my-edit"
cat "$VIBE_PARENT/keep-my-edit/unrelated.txt"
python3.12 "$VIBE_PAYLOAD/materialize.py" --verify "$VIBE_NATIVE"
The existing-target refusal should leave the sentence intact. The final verify should still pass for your original listed files. If you already intentionally edited its readiness record, inspect that specific diff instead of resetting it to obtain a green verification result.
Save an honest readiness record
Open records/readiness.json in your native copy. It is a blank input template,
not prefilled evidence. Record your absolute owned path, manifest SHA, initial
Git HEAD, actual versions, commands/results and browser/refusal observations.
Keep failed and unrun checks distinguishable. contracts/evidence-labels.md
explains the fields.
For example, this illustrative measurement excerpt is reasonable when you know you made no model calls and did not measure the other fields:
{
"elapsed_seconds": null,
"model_calls": 0,
"prompt_tokens": null,
"generated_tokens": null,
"currency": null,
"total_cost": null
}
Zero calls is an observed count. null is unavailable/not recorded, not zero.
A package download is not an AI inference call, and absent billing data does not
establish zero total cost for hardware, downloads or your time. Fill actual
values only; do not copy sample results as your own observations.
Now run:
git status --short
git diff -- records/readiness.json
git diff --cached
You should see M records/readiness.json if only that tracked working file was
edited. The blank first column means no staged change; M in the second column
means a working-tree modification. If you later deliberately stage that file,
M moves to the first column: the index changed. Inspect both diffs before
making a recovery decision. Keep your readiness edit; do not reset it to make
status look clean.
Your completed readiness record is output A01 for the next lesson. Keep the native source, original payload, record, Git checkpoint and selected database. After saving evidence, you may remove only the disposable tamper/unrelated-edit copies you created, after confirming their exact paths. Do not delete the main workbench, another repository, shared caches or an unfamiliar service.
When the result differs
| Observation | Meaning and next bounded action |
|---|---|
| ZIP or native digest mismatch | Different bytes; stop, compare the current course identity and inspect/download a fresh copy |
| Symlink/unsupported host refusal | The required path/platform guard is unavailable; use a physical supported path or obtain verified support, without disabling it |
| Existing or partial destination | State is being preserved; inspect it and use another absent target |
| Frozen lockfile or version failure | Tool/package inputs disagree; verify the named versions and supplied lock before changing anything |
| Type/build failure | Stop before execution; retain output and inspect the exact source/configuration; old emitted code is not a successful rebuild |
| Native test fails | Record the named case and actual observation; do not delete the test or broaden the expected result |
| Seed refuses or app opens the wrong data | Verify the native root, exact new database name, seed output and start record; preserve existing files |
| Address already in use | Another listener owns the port; choose a different owned port and read the new URL |
| Original verify fails after an intentional edit | Compare that edit against the recorded baseline; the hash mismatch is truthful |
A partial materialization is not repaired in place. A missing/mismatched completion marker or retained failure output requires inspection and a fresh absent destination. The script neither deletes the partial copy nor promises power-loss atomicity. Keep the failed state until you understand it.
Check your conclusion
A colleague says: “The download hash matched and all twelve tests passed, so the code is trusted and ready to deploy.” Which parts are supported?
The hash supports matching bytes against the stated course identity. The tests support their disclosed baseline behaviours in the recorded environment. Neither establishes supplier trust, complete security/accessibility, independent competence or deployment readiness. Your A01 record makes those limits explicit so the next lesson starts from an explainable state.