<!-- Authored per the the-loop:writing skill. -->
Tasks: the poll clocks are this machine's, not the repository's
The last spec artifact (requirements → design → testing plan → tasks). Derived mechanically from
design.mdandtesting-plan.md; it has no approval gate.
Task list
- [x] 1. The machine-local clock store
cli/the_loop/pollclocks.py:CLOCK_KEYS,PollClockStorewithbeside,get,put,forget,all; atomic write, best-effort on every fault.- Depends on: none
- Requirements: R1.1, R2.5, abuse 2–3
- Test: T1/T7 —
pytest cli/tests/test_pollclocks.py(red→green)
- [x] 2. Declare the new path
StateLayout.poll_clocks=<root>/local/poll-clocks.json, plus itsGENERATED_PATHSentry (portable=False,holds,why); pinbeside()against it.- Depends on: 1
- Requirements: R3.1
- Test: T6 —
pytest cli/tests/test_state_portability.py(red→green: S1 fails on an unclassified path)
- [x] 3. Split the poller's storage boundary
PollState.__init__takes the clock store;_loadmerges (local wins, the record's own value is the upgrade fallback);_store_ledgerwrites the clocks first, then the clock-free body — and only when that body changed.- Depends on: 1
- Requirements: R1.1–R1.6, R2.1, R2.2, R2.3
- Test: T2/T5 —
pytest cli/tests/test_poller.py(red→green)
- [x] 4. Feed the daemon the declared path
PollerOptions.clock_filefromStateLayout.poll_clocks, passed intoPollState.- Depends on: 2, 3
- Requirements: R1.1
- Test: T2 —
pytest cli/tests/test_poller_daemon.py cli/tests/test_poller.py
- [x] 5. The clocks go with a reset
reset_work_itemdrops the ref's clocks on a real run.- Depends on: 1
- Requirements: R1.5
- Test: T3 —
pytest cli/tests/test_reset.py(red→green)
- [x] 6. Re-join the halves for the control plane
core.workitemsmerges this machine's clocks into thepollsection and eachpullRequestsledger it serves.- Depends on: 1
- Requirements: R2.4
- Test: T3 —
pytest cli/tests/test_core_workitems.py cli/tests/test_core_attention.py(red→green)
- [x] 7. The restart scenario
- A Gherkin-documented integration scenario: a poller restarted after a cycle does not re-ask about the item it just polled, and the record it left is clock-free.
- Depends on: 3, 4
- Requirements: R1.1, R2.1
- Test: T4 —
pytest cli/tests/test_poller_integration.py
- [x] 8. Documentation and the durable record
docs/cli/state.md(the classification table, thepollsection, the attribute table, the new file's own section),docs/capabilities/webhook-triggers.mdanddocs/capabilities/control-plane.md,ui/src/api/types.ts's comment, anddocs/decisions/decision-132.md.- Depends on: 2, 3, 6
- Requirements: R3.1, R3.2, R3.3
- Test: T6/T8 —
pytest cli/tests/test_state_portability.pythenmake check
- [x] 9. Verification
- Execute
testing-plan.md: run every activity, tick it, record command/outcome/evidence. - Depends on: 1–8
- Requirements: all
- Test: T8/T14 —
make check, then twopoll --oncecycles over this checkout
- Execute
Dependency graph (DAG)
Checkpoints
After tasks 1, 3, 6 and 8 the affected suites run; after task 9, make check and the manual dogfood. Each task's red→green transition is recorded in the commit that carries it — no progress log (issue-365).
Review comments
Appended by the-loop's
record-feedbackhook when a human gate approves with comments.