PRD-220: Land drift audit, annotations, and helper consolidation#155
Draft
peterulsteen wants to merge 3 commits intomainfrom
Draft
PRD-220: Land drift audit, annotations, and helper consolidation#155peterulsteen wants to merge 3 commits intomainfrom
peterulsteen wants to merge 3 commits intomainfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…st.ts (#124) - Classifies telemetry-loop-integration.test.ts as Class C (not stale) - Documents actual symphony-loop.ts spawn sites (lines 1836, 4349, 4374, 4407, 4446, 4467, 4500) correcting PRD's inaccurate citations (1733, 3697-3830) - Documents telemetry emission sites (lines 2923, 3339, 3409, 4162, 4253, 4517) - Records close-out rationale: all 6 tests pass against current production code, no PTY migration ever existed in the codebase - Confirms zero matches for spawnPtySession/spawnPty/pty.spawn/node-pty Testing: tsx --test apps/desktop/test/telemetry-loop-integration.test.ts passes 6/6 tests; just desktop-lint clean Risks: None identified Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add drift-check comments in spawn-related tests pointing to their current production source line numbers in symphony-interactive.ts, codex.ts, learnings.ts, error-handlers.ts, boot-recovery.ts, spawn-retry.ts, and git-helpers.ts so test/source drift can be detected mechanically. - Document the known Class (i)/Class (ii) drift in spawn-hardening tests (a) and (a-unref) at the top of spawn-hardening.test.ts; remediation is deferred to Feature 3. - Replace inline buildMockChildProcess() and makeEnoentError() copies in spawn-enoent-characterization and spawn-retry tests with imports from the shared helpers/spawn-test-utils module. - Restore setShellPathForTest() calls in loop-finalizer and symphony-loop-auto-clone tests after PATH overrides so child processes resolve binaries from the test fixture directory. Testing: - Static change only; existing test suites continue to import the same helpers and behave identically. Run `just desktop-test` to confirm. Risks: - Low. Comments and import refactors only; no production code touched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Audited all 73 test files in apps/desktop/test/ against production sources; 63 files have no drift patterns, 10 are annotated - Annotated drift-check headers in boot-recovery, codex-log-parsing, codex-spawn-enoent, error-handlers, git-helpers-shell-safety, spawn-enoent-characterization, spawn-retry, and spawn-hardening - Vocabulary decision adopted: two-form standard -- // drift-check: matches for Class (i) line-anchor annotations, // drift-check: replicates for Class (ii) pattern-replication sites. Applied consistently to spawn-enoent-characterization (489, 1047), spawn-hardening tests (b)/(c)/(d) (489, 1047, codex.ts:1985, learnings.ts:264), reflecting the entire pattern-replication surface per PRD-220 vocabulary rationale. - Fixed boot-recovery.test.ts annotation anchor: :303 -> :308 (isProcessRunning(pid) line in boot-recovery.ts) - Swept stale prose contradictions in codex-spawn-enoent.test.ts header block (lines 17-23) so prose line citations no longer contradict adjacent // drift-check: annotations - Added JSDoc on makeEnoentError documenting code: 'ENOENT' and syscall: 'spawn' fields, with note for callers needing a syscall-free shape - New: apps/desktop/test/DRIFT-AUDIT.md -- in-tree mirror of the audit table for downstream FEA-618/619/621 to consume without reaching for PR description archives - CLAUDE.md: added a pointer to the new DRIFT-AUDIT.md under Learned Patterns - apps/desktop/package.json: patch version bump 0.13.20 -> 0.13.21 Testing: just desktop-typecheck, just desktop-lint, just desktop-test all expected to pass; this PR is annotation-only with no production source changes. Risks: None identified -- changes confined to test annotations, test/helpers JSDoc, a new in-tree audit document, a CLAUDE.md pointer, and a desktop package patch version bump. No production runtime code modified.
fd4f4b4 to
98aa9f1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Squash-merge of integration branch
symphony/prd-220containing the completed portion of PRD-220 — Fix Stale Mocks in closedloop-electron. Test-only changes; no production runtime modified.Bundles three already-merged-to-integration PRs:
telemetry-loop-integration.test.ts→ Class C, not stalebuildMockChildProcessandmakeEnoentErroronto shared helpers; restoredsetShellPathForTest()apps/desktop/test/DRIFT-AUDIT.md; settled two-form annotation vocabulary (matchesvs.replicates); JSDoc onmakeEnoentError; CLAUDE.md pointerWhat's deferred to follow-up
These small remaining items will land in one short follow-up PR rather than four orchestrated FEAs:
apps/desktop/CLAUDE.md(~15 lines).github/workflows/test.yml(PR description note)ClosedLoop FEA-618 / 619 / 620 / 621 will be marked OBSOLETE in favor of one consolidated successor.
Test plan
.github/workflows/test.yml)pnpm -C apps/desktop testpasses (note: typecheck locally requiresGITHUB_TOKENfor@closedloop-ai/loops-api@0.2.9; CI installs cleanly)apps/desktop/test/DRIFT-AUDIT.mdrendered on the PR diff🤖 Generated with Claude Code