Repository navigation
test: drop route copies of the script ancestry matrix - #4671
Conversation
…t paths The writer ancestry suite repeated the path shapes that host-kit's destination rule already pins. Keep three cases that host-kit cannot see: a private acceptance, a missing-parent refusal that proves the writer creates nothing first and returns the typed refusal, and a link-plus-`..` save that proves the writer passes the caller's spelling through without folding it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The remote ancestry suite repeated host-kit's path-shape matrix. Keep a missing-parent refusal that also proves no version is fetched and the warning is disclosed, one success that pins both physical staging and the physical commit, and the replacement-during-download refusal. host-kit had no positive for creating a missing level under a sticky directory this user owns, so pin it there. The test-kit ownership fixture has no remaining consumers, so remove it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
|
The PR is ready at 9e0afa6: dropping the route copies of the script ancestry matrix looks right, since the host-kit tests still cover the walk and the retained route tests still reach the same route functions. Not blocking: the retained route tests (for example daemon-artifacts-script-ancestry.test.ts), the daemon file and the new host-kit sticky test carry long comments about the link/.. fixture layout, and trimming each to the one-line invariant it pins is optional. CI is still running (Smoke Tests, Coverage) and nothing has failed. There are no conflicts. |
This comment has been minimized.
This comment has been minimized.
|
I'm withdrawing the earlier ready verdict at 9e0afa6 and removing the ready-for-human label. A mutation cross-check of this head found two regressions that the retained tests no longer catch:
Please keep one case per route for each of these, so the matrix lives in host-kit and each route still proves it hands host-kit the spelled path unchanged. I'll review again at the new head. |
Canonicalizing the parent or creating directories before the rule answers are writer-side changes that host-kit cannot see. Restore a private link standing on shared ground, the missing-directory backtrack, and the unsafe `..` destination, each asserting that the refusal leaves no directory behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore the missing-directory backtrack, the unsafe `..` destination, a private link on shared ground, and a foreign-owned hop. Read every refusal through readScriptDeliveryFailure with its publication ID. The success case now asserts that the swap ran, and the replacement case retargets an alias so a skipped confirmation would publish. Keep the test-kit ownership fixture, which the foreign hop uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Restore the staging-location assertion in the link-plus-`..` success, which catches a writer that judges the destination but stages beside the caller's spelling. Run the shared-link refusal with and without force, since a forced write takes its own publish branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extend the staging race to a revision-2 replacement, which is published by rename rather than link. Add a success case whose folded parent is absent and must stay absent. Assert the replacement refusal's warning. Pin, in host-kit, the missing-parent creation under umask 0200, which needs the post-mkdir chmod. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Run the link-plus-`..` success with and without force, with the folded directory absent, so forced writes that stage beside the spelling and a stray `mkdir` of the folded parent are both caught. Assert the recovery hint on the missing-parent refusal for world- and group-writable ground. Add one active `session save-script` case that expects the typed refusal for a shared directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run the staging race with and without force, and the retarget during download on the first, forced first, and replacement versions, so each publish branch must stage, commit and confirm in the judged directory. Assert a non-empty hint on the replacement refusal. The folded-parent case now creates its level under a sticky directory, which restores the sticky-parent coverage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A completed replay repair publishes to an explicit caller output, so it goes through the same destination rule. Add one refusal case next to the commit-when-complete test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add two rows to the download race: the parent directory removed and recreated at the same path, and the parent made group-writable. A route that skips confirmation when the spelled parent matches the prepared directory now fails both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I reviewed 27e2b49 and found no problems in the code. The earlier findings from 9e0afa6 (#4671 (comment)) are now fixed, and nothing remains open from them. 16 of 17 checks pass and the last one is still queued. The diff touches only test files, so no failing job covers a production route. There are no conflicts. The assertions match session-script-writer.ts and host-kit atomic-file.ts, and the mutation results come from the PR body. The Windows paths are skipped by skipIf, and no CI lane runs Windows, as the PR body says. Nothing else needs to change before merge. |
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
packages/daemon/src/core/__tests__/session-script-writer-ancestry.test.ts:42 |
🆕 Daemon ancestry test matches host-kit's hint prose verbatim, incl. a phrase with no path |
Reviewed with this repository's own Sentinel configuration (684c59480774).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 27e2b49. The verdict and the full list are in the summary comment.
| test.skipIf(process.platform === 'win32')( | ||
| 'a recording saves a private script under a chain only this user can write', | ||
| () => { |
There was a problem hiding this comment.
🆕 🟡 Minor · Daemon ancestry test matches host-kit's hint prose verbatim, incl. a phrase with no path
hint: (_dir: string) => 'only you can write' asserts the refusal's hint contains that literal phrase, so any rewording in host-kit's hint prose fails this daemon route suite even though nothing the writer does changed. AGENTS.md says "Do not match error text."
| test.skipIf(process.platform === 'win32')( | |
| 'a recording saves a private script under a chain only this user can write', | |
| () => { | |
| test.skipIf(process.platform === 'win32').each([ | |
| { mode: 0o777, exposure: 'world_writable', hint: undefined as string | undefined }, | |
| { mode: 0o775, exposure: 'shared_group_writable', hint: (dir: string) => `chmod g-w ${dir}` }, | |
| ])( |
Details
persona: maintainability
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
Summary
Removes route-level copies of the path-shape matrix that #4584 added. host-kit's destination rule owns those shapes. Touches 5 files.
session save-script, and a completed repair, each to a shared directory.Validation
Mutations ran on this patch in a disposable checkout on macOS, Vitest
unit-core. The route, handler and repair cases skip on win32. In host-kit, the 15 decision cases and the parent suite's relative-path case also run on Windows. No CI lane runs Windows..., umask 002, sticky creation, confirm, staging, file modechmodaftermkdirEACCES)realpath(always or forced); forced writes through the generic publisher..(force ×2,staged)mkdirafter approval..(home/ystays absent)mkdir, fold, bypass, rewrapped error..chmod g-w <dir>)realpathat record creationmkdir, before or after approval; fetch firstfetches), sticky folded-parentswaps,staged, bytes)reasonchanged, cause, warning or replaced hint droppedreadScriptDeliveryFailurepnpm typecheck,pnpm lint,pnpm check:production-exportsandpnpm check:fallowpass.pnpm exec vitest run --project unit-coreover the two route suites, the handler suite, the writer suite, the three host-kit suites, and the hostile-daemon and download suites gives 187 passed. CI validates the pushed head.🤖 Generated with Claude Code