# Implementation log

- Created the branch from main after 0.33.0. The unrelated untracked `specs/2026-10-01-open-pr-disposition/` directory is excluded from this work.
- Reviewed all five PR descriptions, patches and original commit identities. Prior review reproduced the cache-prefix failure and showed a stale checkpoint pausing a replacement goal on actual Pi 1.4 with zero provider requests. The latter needs a lifecycle fix beyond the proposed runningGoalId assignment.
- Chose one task-input policy for #91/#92, explicit host-version context registration, scheduler-level stale-dispatch rejection, and a focused Windows atomic-rename helper. No automatic background waiting or resume-feedback feature is included.
- The first focused task run caught the old test's blanket mixed-form rejection; retained its rollback coverage using genuinely conflicting root fields. All 112 focused normalization, task, scheduling and stale-checkpoint checks then passed. Real SDK argument validation passes ten cases, including malformed input without partial writes and a literal `-` task ID.
- Pi 1.4 now rejects four stale dispatch forms with zero provider requests and leaves the replacement file unchanged. Subsequent completion succeeds. Extending the native test to older SDKs exposed a startup-cancellation hang; investigating the complete event trace rather than weakening the test. An exact token assertion also exposed the existing completion-request accounting boundary and needs an appropriate run-attribution check.
- Context selection is verified against installed SDK sources: 0.83–0.86 expose VERSION and use context; 0.87 and later expose the full-transcript event. The provider regression passes from the first prefix through compaction for ordinary, automatic and delegated sessions on 0.87, 1.0 and 1.4.
- Atomic rename tests cover no extra fast-path reads, actual replacements, recoverable simulated Windows errors, permanent errors, bounded waits, permissions, and temporary-file ownership/cleanup. Added a path-scoped Windows matrix group and native no-delete-sharing tests; Linux compatibility coverage is retained.
- Reasserting rejected-dispatch cancellation at the awaited context boundary fixes the legacy startup loop without a provider call. Added tests for both startup orders, saved dispatch preservation, user turn holds, and subsequent actual work/completion. The SDK workflow now writes and verifies an artifact and checks that the work is charged to the new goal; final-completion-only accounting is a separate existing boundary, so this change leaves accounting semantics alone.
- Expanded the provider fixture to alternate tool profiles, change models and compact, keeping the first prefix and each new model/compaction prefix stable. These checks pass on Pi 1.0 and 1.4; no additional legacy prompt-profile rewrite was necessary.
- User narrowed host support to Pi 1.0+. Updated PRODUCT then TECH before simplifying the implementation. Replace the initial version-selecting context helper with direct full-transcript registration, retire 0.x compatibility jobs, and update the host/Node declarations and current documentation. The earlier 0.x investigations remain recorded as validation history, not supported behavior.
- User then narrowed the target further to Pi 1.4 and requested Windows testing for this PR only. Updated PRODUCT then TECH: remove the custom-turn prompt repair, drop the historical host matrix, validate at Node 22.19, and remove the temporary native Windows CI job after recording its result. Keep deterministic Windows simulations in the regular suite and native tests available for manual use.
- Actual mid-run creation exposed that a queued follow-up is processed within the original logical run, not as a separate settlement. Adjusted the regression to assert one rejected message, two settled logical runs, exactly three provider requests, correct run bindings and one replacement allowance claim. Native retries retain the original run identity; replacement creation saves a fresh kickoff.
- The context gate initially exposed an outdated capture harness calling `context` rather than the full-transcript hook. Updated it to chain extension handlers and assert preservation of the host head. All 24 semantic snapshots and goal-message sizes match the baseline; seven task-enabled fixtures grow by exactly 73 schema characters. Refreshed the baseline for that intentional, small argument-guidance change.
- Exact request-by-request accounting assertions reproduced a second handoff bug: creation left replacement usage at 16 tokens before its first request, then 32 before completion. Guarded accounting startup and charging against a run/focus mismatch; expected replacement usage is now 0 then 16. The six Pi 1.4 standard-user SDK paths must always exercise native prompt preparation, including another extension's system instruction and startup abort, with no older-host test escape paths.
- All 1,216 tests pass with zero skips on Node 22.19; all ten installed Pi CLI walkthroughs and the separate lifecycle check pass. Context/provider gates, production audit, package dry run, types/lint, workflow tests and actionlint pass. The 105-case comparison against main passes with no regression (base 19.3s, branch 18.9s; local timings are descriptive).
- Opened draft PR #107. GitHub's commit-author API resolves all five co-author trailers to the intended accounts, including fan92rus's ID-based noreply address.
- First native Windows run: 13/14 pass; synchronous recovery failed while the PowerShell lock holder's first cmdlet invocation exceeded the 75ms retry window. Async recovery and permanent-failure cleanup pass. Replaced cmdlet polling with a precompiled .NET holder, prepared before READY, rather than increasing production blocking time. Also hardened holder startup cleanup and checked preservation of POSIX permissions when a stricter process umask would otherwise change them.
- The prepared holder passes all 14 Windows checks on 58f8d66. A final call-site audit found the pool snapshot's delta-update writer still using raw rename; routed it through the same bounded helper and cleanup, and added a native OS-lock regression for that public write path. Keep the temporary job for this final storage validation, then remove it.

- Final Windows validation passes 15/15 on 3a9ed4d, including real contention on the snapshot delta writer: https://github.com/tmonk/pi-goal-x/actions/runs/40092852584/job/120868921488. Removed the temporary Windows job after that result. Runtime sources/tests are unchanged by the final CI/documentation commit; regular CI now has one Linux validation job for Pi 1.4 on Node 22.19. Contributor co-author mappings are verified on GitHub, and PR #107 links all five original contributions.

- Merged #107 as 8f0c28b and released v0.34.0 after the whole-project Pi 1.4 audit. Release/main CI and published-package verification pass; contributor commits and release-note credits are preserved. See ../2026-10-24-release-0-34-0/VALIDATION.json.
