Skip to content

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

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

Derived from design.md and testing-plan.md. Each task is test-first. For the migration tasks, the existing tests that pin today's text are the red/green signal: they must stay green across the move, and a new test asserts the module no longer holds the prose.

Task list ​

  • [x] 1. the_loop.prompts loader
    • load(name, inline=False), render(name, **slots), names(); name pattern check; lru_cache; importlib.resources.
    • Add cli/the_loop/prompts/** to .markdownlint-cli2.jsonc ignores.
    • Depends on: none
    • Requirements: R1.2, R1.7, security (path traversal)
    • Test: T1, T6 — pytest tests/test_prompts.py (red→green)
  • [x] 2. the_loop.strings catalog and lookup
    • t(key, **vars), section(prefix), catalog(locale), set_locale; THE_LOOP_LOCALE; locale-directory injection for tests; en.json created.
    • Depends on: none
    • Requirements: R2.1–R2.4
    • Test: T1, T14 — pytest tests/test_strings_catalog.py (red→green)
  • [x] 3. Webhook templates and interaction directives → prompts
    • prompts/webhook/event.md, webhook/autoexecute.md, webhook/truncated.md, interaction/{artifact-rule,work-item,cli}.md; dispatcher, excerpt and interaction read them; sync test against skills/the-loop/templates/webhook-*-prompt.md.
    • Depends on: 1
    • Requirements: R1.1, R1.3–R1.6, abuse cases 1 and 3
    • Test: T2, T3, T6 — pytest tests/test_interaction.py tests/test_prompts.py (stay green; new sync + literal-payload tests red→green)
  • [x] 4. Graph prompts → prompts (graphlink.render_graph_context and its lines, assignment.render_assignment)
    • Depends on: 1
    • Requirements: R1.1, R1.3, R1.4
    • Test: T2 — pytest tests/test_graph*.py tests/test_claude_*.py tests/test_handoff_pickup.py tests/test_graphlink_integration.py (stay green)
  • [x] 5. Session-bound notices → prompts (prnotice, cimonitor.render_section, attachments section frame, sessions frames + RESTART_NOTICE, standing directive/surfaces/frame)
    • Depends on: 1
    • Requirements: R1.1, R1.3, R1.4
    • Test: T2 — pytest tests/test_prnotice.py tests/test_pr_notices_integration.py tests/test_cimonitor.py tests/test_attachments*.py tests/test_core_sessions.py tests/test_channels_mentions*.py tests/test_standing*.py (stay green)
  • [x] 6. One-shot prompts → prompts (selfdiagnosis prompt + dossier lines, mcp-call hook prompt, modelprobe.PROBE_PROMPT, codex_support marker + AGENTS.md block, api/mcp.py server instructions)
    • Depends on: 1
    • Requirements: R1.1, R1.3, R1.4
    • Test: T2 — pytest tests/test_selfdiagnosis*.py tests/test_modelprobe.py tests/test_codex*.py tests/test_mcp*.py tests/test_graph_hooks*.py (stay green)
  • [x] 7. Keyed human-message catalogs → en.json
    • dispatcher CONTROL_REFUSAL_REMEDIES; slack KICKOFF_REFUSALS, COMMAND_DESCRIPTIONS, BUTTON_NAMES labels, _TITLES; attachments _REASONS; bodies _MIRROR_LINES; digest _POINTERS — each built with strings.section(...).
    • Depends on: 2
    • Requirements: R2.5, R2.6, abuse case 2
    • Test: T2, T3 — existing slack/dispatcher/attachments/bodies/digest tests stay green; pytest tests/test_strings_catalog.py placeholder-parity and used-keys tests red→green
  • [x] 8. Guard test
    • AST scan for multi-line prompt-named module constants; planted-fixture self-test.
    • Depends on: 3, 4, 5, 6
    • Requirements: R3.1
    • Test: T4 — pytest tests/test_prompts_guard.py (red on the pre-migration tree, green after)
  • [x] 9. Docs
    • New capability doc docs/capabilities/prompts-and-strings.md (conventions, the left-inline list, how to add a locale); CLAUDE.md/AGENTS.md contributor note; docs/capabilities index; follow-up issue filed for the long tail.
    • Depends on: 7, 8
    • Requirements: R3.2
    • Test: T7 — make lint
  • [x] 10. Packaging check
    • Build the wheel and confirm the data files ship; smoke-import from the installed wheel.
    • Depends on: 3–7
    • Requirements: R1.5
    • Test: T5

Scope extension (owner feedback on PR #541) ​

Each group moves every human-facing string in its modules to en.json (or every agent-facing one to prompts/), keeps the rendered text byte-identical, and runs its own modules' tests. The groups are disjoint, so they can run in parallel.

  • [x] 11. commands/ — CLI output and argparse help (cli.* keys)
    • Depends on: 2
    • Requirements: R2.5, R2.7
    • Test: T2 — the tests/test_*_cmd.py and CLI scenario tests stay green
  • [x] 12. Top-level modules (cli/the_loop/*.py) — comment bodies, CLI output
    • Depends on: 2
    • Requirements: R2.5, R2.7
    • Test: T2
  • [x] 13. channels/ — Slack, Jira and GitHub message bodies, replies, digests
    • Depends on: 2
    • Requirements: R2.5, R2.7
    • Test: T2 — tests/test_channels*.py, tests/test_slack*.py
  • [x] 14. core/, sessions/, lifecycle/, harness/, client/ — reports, announces, notices
    • Depends on: 2
    • Requirements: R2.5, R2.7
    • Test: T2
  • [x] 15. webhook/, poller/, gateway/ — posted replies, refusals, status output
    • Depends on: 2
    • Requirements: R2.5, R2.7
    • Test: T2
  • [x] 16. graph/ — the phase-selection checklist, quiz, review and side-effect comment bodies
    • Depends on: 2
    • Requirements: R2.5, R2.7
    • Test: T2 — tests/test_graph*.py, tests/test_selection*.py
  • [x] 17. api/, manager/, sdk/, scenarios/ + MCP tool descriptions → prompts/mcp/tools/ + stop hook → hooks/prompts/gate-feedback.md
    • Depends on: 1, 2
    • Requirements: R1.1, R2.5
    • Test: T2, T16 — tests/test_mcp*.py, tests/test_api*.py, tests/test_sdk*.py, tests/test_harness_gate.py
  • [x] 18. UI — ui/src/i18n.ts + every component string → ui.* keys
    • Depends on: 2
    • Requirements: R2.5, R3.2
    • Test: T10
  • [x] 19. Integrate: catalog tests (the ui. prefix is owned by the UI test), capability doc, full suite, make check
    • Depends on: 11–18
    • Requirements: R2.6, R3.3
    • Test: T2, T7, T10

Dependency graph (DAG) ​

Checkpoints ​

Full suite (make test) after tasks 3, 5 and 7, and make check after task 9. Each task lands as its own commit. The verification node then executes testing-plan.md.

Released under the MIT License.