Skip to content

<!-- Authored per the the-loop:writing skill. -->

Testing plan: prompts in Markdown files, application strings in one JSON catalog ​

Derived from requirements.md and design.md. The existing suite does most of the proving: it already pins today's prompt and message text, so a green run after the move is the evidence that rendered output stayed byte-identical (R1.4, R2.5). New tests cover the loader, the lookup, the fallback, the sync between the skill templates and the packaged prompts, the guard, and packaging.

Test matrix ​

#TypeApplies?Scope / what it provesWhere it runs
T1Unityesprompts.load/render/names, strings.t/section/catalog, fallback, missing file/key errors, name validationmake test (cd cli && uv run python -m pytest -q)
T2Regression (existing suite)yesevery test that pins prompt or message text still passes unchanged, so output is byte-identicalmake test
T3Contract (data files)yesen.json is a flat object of string values with valid keys; placeholders match call-site vars; every t/section key used in code exists; skill templates equal prompts/webhook/*.mdmake test (cli/tests/test_strings_catalog.py, test_prompts.py)
T4Guard (static)yesR3.1: AST scan fails on a multi-line prompt-named module constant; a planted fixture proves it firesmake test (cli/tests/test_prompts_guard.py)
T5Packagingyesthe built wheel contains the_loop/prompts/**/*.md and the_loop/strings/en.json; an installed wheel renders a promptuv build --wheel cli + unzip -l + a venv smoke run
T6Security / abuse caseyes$work_item / {name} inside an untrusted payload come out literal; a prompt name with .. is rejected; t with an unknown key raisesmake test
T7Static checksyeslint, format, typecheck and config validation stay greenmake check (ruff, markdownlint, pyright, validate, pytest)
T8Integration (scenario)n/ano new routing behaviour; the existing webhook→session scenarios run in T2 and render through the new loader—
T9End-to-endn/athe daemon's behaviour does not change; T2 + T5 cover the render path end to end without a live GitHub—
T10UI unityesthe UI suite still asserts today's English text after every string moves to t(); i18n.test.ts checks used keys ↔ ui.* catalog keys and the missing-key throwcd ui && npm test + npm run typecheck + npm run lint
T11Performancen/aone cached file read per prompt per process; nothing measurable—
T12Accessibilityn/ano UI change—
T13Migration / upgraden/ano config, schema or state-file change; promptTemplate/spawnTemplate overrides keep working (covered by existing tests in T2)—
T16Stop-hook feedbackyeshooks/the-loop-gate.py renders its feedback from hooks/prompts/gate-feedback.md byte-identicallymake test (tests/test_harness_gate.py)
T14i18n fallbackyesa fixture locale with one translated key and one missing key: translated key returns the translation, missing key returns en, invalid locale file warns and falls backmake test
T15Manual exploratoryn/anothing user-visible changes—

Scenarios & requirement trace ​

RowRequirement(s)Case
T1R1.2, R1.7, R2.2, R2.4loader reads a file; missing prompt raises naming the file; t formats vars; missing key raises naming the key
T2R1.1, R1.3, R1.4, R2.5existing dispatcher/interaction/standing/selfdiagnosis/sessions/assignment/slack/prnotice/attachments/bodies/digest tests unchanged and green
T3R1.6, R2.1, R2.6catalog shape; placeholder parity; used keys exist; skill templates identical to packaged prompts
T4R3.1guard passes on the tree; guard fails on a planted multi-line FOO_PROMPT = """…"""
T5R1.5wheel lists the data files; python -c "from the_loop import prompts; prompts.load('webhook/event')" from the installed wheel
T6Security abuse 1–2, fail-closedpayload $work_item {name} stays literal in the rendered spawn prompt; prompts.load('../x') raises ValueError
T7R3.2 (docs lint), NFR no new dependencymake check green; cli/pyproject.toml dependencies unchanged
T14R2.3fixture xx.json via THE_LOOP_LOCALE=xx
T10R2.5 (UI), R3.2UI tests unchanged and green; i18n.test.ts
T16R1.1 (stop hook)gate feedback text unchanged
T2R2.5 (CLI messages and comment bodies)every existing CLI/comment test unchanged and green after the move

Verification environment ​

  • Repositories: this repository only.
  • Services / containers: none.
  • Fixtures & data: temporary locale files written by the tests under tmp_path; the locale directory is injected, so the shipped package is not modified.
  • Credentials: none.
  • Bring-up: uv sync · Tear-down: none.
  • If bring-up fails: record it under Verification results and escalate.

Evidence plan ​

RowEvidencePath under evidence/
T1–T4, T6, T14pytest summary (counts) and the new tests' namesverification.md
T5unzip -l excerpt for the data files and the smoke-run outputverification.md
T7make check summaryverification.md

Verification activities ​

  • [x] T1, T3, T4, T6, T14 — cd cli && uv run python -m pytest -q tests/test_prompts.py tests/test_strings_catalog.py tests/test_prompts_guard.py
  • [x] T2 — cd cli && uv run python -m pytest -q (full suite)
  • [x] T5 — uv build --wheel cli -o <tmp> then unzip -l <wheel> | grep -E 'the_loop/(prompts|strings)/' and a smoke import from a fresh venv
  • [x] T7 — make check
  • [x] T2 (scope extension) — cd cli && uv run python -m pytest -q, full suite after the whole-application migration, CI-equivalent env
  • [x] T10 — cd ui && npm ci && npm test && npm run typecheck && npm run lint && npm run build
  • [x] T7 (scope extension) — make check after the migration

Verification results ​

Executed 2026-11-18 at d0470779. Raw output: evidence/verification.md.

ActivityCommand / procedureOutcomeEvidence
T1, T3, T4, T6, T14pytest tests/test_prompts.py tests/test_strings_catalog.py tests/test_prompts_guard.py36 passed; guard reports the 6 inline prompts on origin/mainV1
T2full suite, daemon env vars unset as in CI6992 passed. Old-vs-new render hashes identical over 66,174 casesV2
T5uv build --wheel cli; unzip -l; fresh-venv smoke import101 prompt files + en.json ship; installed wheel rendersV3
T7ruff format/check, pyright, markdownlint, validate_config.pyall green; dependencies unchangedV4
T2 (scope extension)full suite after the whole-application migration, daemon env vars unset6998 passedV5
T10npm test, typecheck, lint, build in ui/379 passed (23 files); typecheck, lint and build clean; bundle holds only ui.* keysV5
T7 (scope extension), T16ruff, pyright, markdownlint, validate_config.py; catalog, prompt, guard and stop-hook testsall green; 80 passedV5

Review comments ​

Released under the MIT License.