[S19] devops : worktree + poetry guardrails v2#132
Merged
Conversation
Add worktree context detection, Python traceback suppression with canonical fix path, and dev-setup.sh hardening for offline/worktree use. - worktreeContext.ts: DI-testable git worktree/interpreter detection - nlxErrorSanitizer.ts: replaces raw tracebacks with controlled message + "bash scripts/dev-setup.sh" canonical remediation - nlxService.ts: wires sanitizer into toResponse() for missing_nlx and traceback-containing nonzero_exit errors - dev-setup.sh: worktree detection, --offline flag, context logging - 13 new tests (195 total, 42 files) AT-S19-01: worktree context detection (DI fixture proof) AT-S19-02: traceback suppression (no raw stack frames leak) AT-S19-03: dev-setup idempotent + offline-friendly AT-S19-04: error context attached to sanitized result Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 295469644b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Durable evidence for all 7 required preflight commands: - git fetch --all --prune --tags - git worktree list --porcelain - git rev-parse --show-toplevel - git rev-parse --is-inside-work-tree - git rev-parse --abbrev-ref HEAD - git status --porcelain=v1 --branch - git branch -vv Co-Authored-By: Claude <noreply@anthropic.com>
- New receipt: primary-worktree.json with all 8 required commands from ~/Projects/NextLevelApex (now on main, synced) - Updated worktree-list.json to reflect corrected primary worktree state (main @ 339338f, no longer stale S06 branch) Co-Authored-By: Claude <noreply@anthropic.com>
detectWorktreeContext() compared git-common-dir and git-dir outputs as raw strings. When invoked from a subdirectory, git may return these in different formats (relative ".git" vs absolute "/path/to/project/.git"), causing a false isWorktree=true. Fix: normalizeGitPath() resolves both paths to absolute form via path.resolve() + fs.realpathSync (with path.normalize fallback), then compares the normalized results. New test: verifies no false worktree when relative and absolute paths resolve to the same .git directory. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Sprint S19 — Worktree + Poetry Guardrails v2
Sprint ID:
S19-worktree-poetry-guardrails-v2Objective: Make diagnose work from any git worktree by capturing invocation context (cwd/interpreter/env), replacing raw tracebacks with a controlled message + one canonical fix path, and ensuring dev setup is idempotent and offline-friendly.
Whitelist + Budgets
dashboard/src/engine/worktreeContext.tsdashboard/src/engine/nlxErrorSanitizer.tsdashboard/src/engine/nlxService.tsdashboard/src/engine/__tests__/worktreeContext.test.tsdashboard/src/engine/__tests__/nlxErrorSanitizer.test.tsscripts/dev-setup.shAll files within whitelist:
dashboard/src/**,scripts/**,docs/**.Acceptance Tests
detectWorktreeContext()returns deterministic{cwd, gitTopLevel, isWorktree, interpreterPath, nlxAvailable}via DI shell mock.sanitizeNlxError()returns controlled message with canonical fix (bash scripts/dev-setup.sh); no raw stack frames leak.scripts/dev-setup.shdetects worktree, supports--offline, exits 0 on repeated runs.WorktreeContextwithisWorktree,interpreterPath,nlxAvailable.Evidence
docs/sprints/S19/evidence/:gates.json— test: 195/42, lint: clean, build:○ Staticat-s19-01-worktree-context.jsonat-s19-02-traceback-suppression.jsonat-s19-03-dev-setup.jsonat-s19-04-error-context.jsonTraceback Patterns (suppressed)
Gates
○ (Static)Notes
🤖 Generated with Claude Code