Tasks: say where a spawned session takes its answers from — CLI or the work item
Phase 3 of 3 (requirements → design → tasks). A DAG of implementation tasks derived from the approved design. MUST be reviewed/approved before implementation begins.
Task list
[x] 1.
interaction.py— resolve the mode and own the directive text- New
cli/the_loop/interaction.py:MODES,DEFAULT_MODE,PLACEHOLDER,InteractionConfig.from_mapping,InteractionConfig.directive,apply_directive. - Resolution ladder: absent/
None/non-mapping → default silently; unknown or non-stringmode→ default + warning; case/whitespace normalised. - Depends on: none
- Requirements: R1.1, R1.2, R1.3, R2.2, R2.3
- Test:
pytest cli/tests/test_interaction.py -k "resolve or fallback or directive"(red→green)
- New
[x] 2.
apply_directive— a custom template cannot drop the rule- Appends the directive when the template text declares neither
$interaction_directivenor${interaction_directive}; no-ops when it does. - Depends on: 1
- Requirements: R2.4, Security abuse case 3
- Test:
pytest cli/tests/test_interaction.py -k apply(red→green)
- Appends the directive when the template text declares neither
[x] 3. Schema: the
interactionblock.the-loop/cli-config.schema.jsongainsrouting.interaction(additionalProperties: false) with themodeenum and its default; no version bump, no migration.- Depends on: none
- Requirements: R1.4
- Test:
uv run python scripts/validate_config.py+ a schema test that an undeclared value is rejected
[x] 4. Wire it into the dispatcher
RoutingConfig.interaction+from_mapping;_render_promptsubstitutes and then callsapply_directive; the resolved mode joins bothsession.spawnedemits.- Depends on: 1, 2
- Requirements: R1.1, R1.5, R2.1
- Test:
pytest cli/tests/test_interaction_integration.py(red→green)
[x] 5. Templates carry the placeholder (both copies)
skills/the-loop/templates/webhook-event-prompt.md,skills/the-loop/templates/webhook-autoexecute-prompt.md, and theDEFAULT_PROMPT_TEMPLATE/DEFAULT_SPAWN_TEMPLATEconstants — directive placed above the untrusted payload block.- Depends on: 4
- Requirements: R2.1, R2.5, Security abuse case 1
- Test: parity test in
cli/tests/test_interaction.py
[x] 6. Integration tests with Gherkin docstrings
cli/tests/test_interaction_integration.py: both modes × both prompt paths, the custom-template fallback, and the hostile-comment abuse case.- Depends on: 4, 5
- Requirements: R2.1–R2.5, abuse cases 1–3
- Test:
pytest cli/tests/test_interaction_integration.py
[x] 7. Config files: this repo's own + the
/inittemplate.the-loop/cli-config.yamlandskills/the-loop/templates/cli-config.yamlgain the block, commented in the house style (what it is, why the default).- Depends on: 3
- Requirements: R1.1, R4.1
- Test:
uv run python scripts/validate_config.py
[x] 8. The skill: the artifact-iteration rule and the channel rule
skills/the-loop/reference/collaboration.md— the full rule (§ Where questions go);SKILL.md— one operating principle;reference/automation.md— name the knob.- Depends on: none
- Requirements: R3.1, R3.2, R3.3
- Test:
markdownlint-cli2 "**/*.md"
[x] 9. Operator docs
docs/config/cli/routing-options.md—### interaction.modewith Type/Default.- Depends on: 3
- Requirements: R4.1
- Test:
pytest cli/tests/test_docs_parity.py(red→green: P4 fails first)
[x] 10. Capability doc + decision + spec index
docs/capabilities/webhook-triggers.md(behaviour + history row),docs/decisions/decision-051.md+decisions.md,docs/specs/index.md.- Depends on: 4, 8
- Requirements: R4.2, R4.3
- Test:
markdownlint-cli2 "**/*.md"
[x] 11. Full gates + reviewer briefing
make check(lint, format, typecheck, validate, test), 3 self-reviews, security review, PR briefing from the internal template, security sign-off requested (tier 4).- Depends on: all
- Requirements: all
- Test:
make check
Dependency graph (DAG)
flowchart LR
T1[1 interaction.py] --> T2[2 apply_directive]
T2 --> T4[4 dispatcher]
T3[3 schema] --> T7[7 config files]
T3 --> T9[9 operator docs]
T4 --> T5[5 templates]
T5 --> T6[6 integration tests]
T4 --> T6
T8[8 skill] --> T10[10 capability + decision]
T4 --> T10
T6 --> T11[11 gates + briefing]
T7 --> T11
T9 --> T11
T10 --> T11Checkpoints
- After 2: unit suite green, dispatcher untouched — the domain module stands alone.
- After 6:
uv run --project cli python -m pytest -q cligreen end-to-end. - After 11:
make checkclean; briefing posted; sign-off requested.
Review comments
Appended by the-loop's
record-feedbackhook when a human gate approves with comments.