Tasks: the CLI installs the-loop's own plugin before a spawned session starts
Phase 3 of 3 (requirements → design → tasks). Derived from the locked
design.md.
Task list
[x] 1. Unit-pin the writer's contract (red)
- New
cli/tests/test_harness_plugins.py: exact-shape write into a fresh settings file; idempotence; existing marketplace / existingfalseenablement untouched; non-object container and malformedmarketplaceRepo→ok=Falsewith the file untouched; empty repo → plugin only;$CLAUDE_CONFIG_DIRhonoured;PluginConfig.from_mapping. - Depends on: none
- Requirements: AC R1.1, R1.2, R2.1–R2.5, R3.2
- Test:
uv run pytest cli/tests/test_harness_plugins.py(red — module absent)
- New
[x] 2. Integration-pin the pre-spawn step (red)
cli/tests/test_trust_integration.py: a scenario asserting the plugin keys are in the settings file when the harness process starts, and thatworkspace.trustednames the file. Gherkin docstring +Requirement:link, pertesting.gherkinDocstrings.- Depends on: none
- Requirements: AC R1.1, R3.3
- Test:
uv run pytest cli/tests/test_trust_integration.py -k plugin(red)
[x] 3. Make the JSON writer reusable
cli/the_loop/trust.py: rename_update_json→update_json(public), update its four call sites and the module docstring. No behaviour change.- Depends on: none
- Requirements: NFR (no duplicated atomic writer)
- Test:
uv run pytest cli/tests/test_trust.py
[x] 4. Write the plugin store (green)
cli/the_loop/harness_plugins.py:PluginConfig,ClaudePluginStore.enable(), the name constants and theowner/repoguard, delegating path resolution toClaudeTrustStore.- Depends on: 1, 3
- Requirements: AC R1.1, R1.2, R2.1–R2.5
- Test: task 1 goes green
[x] 5. Call it from the Claude Code adapter (green)
cli/the_loop/harness/claude_code.py+base.py+__init__.py:pluginson the adapter, the independent third step inprepare_environment,build_adapters(..., plugins=…). Cursor stays a no-op.- Depends on: 4
- Requirements: AC R1.1, R1.3, R3.5
- Test:
uv run pytest cli/tests/test_trust.py cli/tests/test_harness_plugins.py
[x] 6. Plumb the config through routing
RoutingConfig.harness_plugins+from_mapping; the threebuild_adapterscall sites (webhook/dispatcher.py,commands/gh_webhook.py,commands/poll.py).- Depends on: 5
- Requirements: AC R3.1, R3.2
- Test: task 2 goes green
[x] 7. Schema + operator config
.the-loop/cli-config.schema.json(harnessPlugins),.the-loop/cli-config.yamlandskills/the-loop/templates/cli-config.yaml.- Depends on: 6
- Requirements: AC R3.1, R3.2
- Test:
uv run python scripts/validate_config.py
[x] 8. Event descriptions
cli/the_loop/eventlog.py:workspace.trusted/workspace.trust_faileddescribe pre-spawn preparation including plugin enablement.- Depends on: 6
- Requirements: AC R3.3, R3.4
- Test:
uv run pytest cli/tests/test_eventlog.py
[x] 9. Config reference docs
docs/config/cli/routing-options.md:harnessPlugins.enabledandharnessPlugins.marketplaceRepo, each with Type + Default and the machine-global warning.- Depends on: 7
- Requirements: AC R3.1, R3.2
- Test:
uv run pytest cli/tests/test_docs_parity.py
[x] 10. Capability doc + decision record
docs/capabilities/interactive-sessions.md(behaviour + history row),docs/decisions/decision-054.md+docs/decisions/decisions.md.- Depends on: 6
- Requirements: loop gate (capability fold-in)
- Test:
uv run pytest cli/tests/test_docs_parity.py
[x] 11. Dogfood in this repository
.claude/settings.json: the two entries from the issue.- Depends on: none
- Requirements: AC R4.1
- Test: JSON validity check from CI (
uv run python -c "import json; …")
[x] 12. Full check + evidence
make lint typecheck test(or the equivalentuv runcommands), execution-log evidence, self-review round, reviewer briefing on the PR.- Depends on: 1–11
- Requirements: ready-to-ship gate
- Test: full suite green