Maintainer carry-forward of the four edge cases reproduced on 5a565cf:
- Same-named project roots: bind the proposal to a SHA-256 owner key of
the full real project root plus the raw session ID, and put that key in
both the file name and the ownership marker.
- Sanitized session-ID aliasing: hash the raw session ID before filename
sanitization so IDs such as owner/a and owner?a no longer share a path.
- Linked or special destinations: probe with lstat, open read-only with
O_NOFOLLOW and O_NONBLOCK, require a regular single-link file whose
complete first-line marker matches, and decline linked handoff
directories. A FIFO at the destination previously hung the prompt.
- Literal resume arguments: emit the resume prompt as one single-quoted
POSIX (or PowerShell on Windows) argument.
Also merge the UserPromptSubmit registration into the existing event
array. The main merge left a duplicate UserPromptSubmit key in
hooks.json and hooks.metadata.json, and JSON.parse kept only the last,
which silently dropped prompt:hookify-runtime.
Adds tests/hooks/context-gate-ownership.test.js, which fires the hook
through the registered run-with-flags.js entry: 12/12 pass here, 1/12
pass on 5a565cf.
ECC's selection, candidates, fallback and receipt stay unchanged. Installed non-ECC skills that also match the task are listed as companions in the resolver result, the ecc profile run launch input and the opt-in suggestion hook, so the host can use ECC's skill and the user's own together. A companion clears the automatic-load score bar and either has a matched word in its name or leads every other neighbor by the existing auto-admission margin. No constant changes.
ecc profile neighbors snapshots the provider home's other skills, including the project's own .claude/skills for Claude, and --neighbors or ECC_CONTEXT_NEIGHBORS passes the snapshot in.
Resolve both sides of the source_doc containment check with
fs.realpathSync.native (falling back to fs.realpathSync). With the JS
realpath, a repo root reached through a Windows 8.3 short name stays in
short form while an in-repo symlink whose target uses the long-path form
resolves to the long form, so a legitimate in-repo doc was reported as
"resolves outside repository root". Escapes outside the repo are still
rejected.
Adds a cross-platform regression test that models differing JS and
native realpath results: in-repo docs are accepted through a short-form
root and an outside target is still rejected. It fails on the previous
implementation.
Not required for the #3882 Windows CI fix; kept as a separate commit so
it can be taken or dropped on its own.
DESTRUCTIVE_SQL matched only DROP TABLE, DELETE FROM and TRUNCATE.
`psql -c "DROP DATABASE prod"`, `DROP SCHEMA public CASCADE` and
`ALTER TABLE users DROP COLUMN email` went to the routine gate instead
of the destructive gate, even though each loses at least as much data
as DROP TABLE.
Add DROP DATABASE, DROP SCHEMA and an ALTER TABLE ... DROP COLUMN arm
to the phrase check. The DROP COLUMN arm stops at `;` so it never
matches across two statements. It requires the COLUMN keyword so
ALTER COLUMN ... DROP DEFAULT / DROP NOT NULL stay passive. Existing
literal and quote stripping keeps SQL strings, commit messages and
echo mentions passive.
Update the gateguard trigger list (en, ja-JP, zh-CN) and rebind the
skill-triggers registry digest for the SKILL.md body edit. Skill
descriptions and triggers are unchanged.
The pattern only accepted settings.json and settings.<suffix>.json, so a plain settings-dev.json stayed editable on the subagent paths that only gate sensitive or hard-linked targets. Use settings[^/]*.json and cover the dash-suffixed variants plus a non-settings control.
GitHub Windows runners use an 8.3 short path for os.tmpdir()
(C:\Users\RUNNER~1\...). git rev-parse --show-toplevel returns the long
path, but JS fs.realpathSync does not expand 8.3 short names, so
isGitWorkTreeRoot compared unequal for a valid worktree and source
preparation fell through to the registry branch and threw.
Prefer fs.realpathSync.native (falling back to realpathSync for injected
fakes) in isGitWorkTreeRoot and findRegistrySource. Fail-closed behavior
is unchanged. Adds cross-platform and Windows-only regression tests.
Fixes the windows npm/full lane on #3882.
Round-6 ownership revision for the enforce-mode checkpoint (PR #3106,
@haelyra requested-changes on fffda19).
1. Require real handoff identity, preserve an occupied destination.
- resolveCheckpointPath -> resolveCheckpointIdentity: drops the literal
'project'/'session' fallbacks. A session id (input.session_id or a
session env override) AND a project are now required; when neither
resolves it returns null and the hook declines enforcement, so two
same-named projects with no session id can no longer collide on one
shared <sessions>/resume/project-session.md path.
- New pickOwnedDestination + readOwnerSession: before targeting an
existing destination the gate checks an ecc-handoff ownership marker.
A file owned by this session is reused (idempotent); an unmarked,
unreadable, or foreign-owned file is never overwritten — the gate
disambiguates to a sibling (-2, -3, ...) or declines.
- Missing-identity fire now emits a degraded advisory (buildDeclineText):
it names no checkpoint path and orders no write, but still warns and
tells the operator to set ECC_SESSION_ID — not a silent drop.
2. Report a proposed handoff until a write is verified.
- buildOrderText no longer calls the resume command a completed "receipt".
The checkpoint is a PROPOSAL; the resume command is gated on an explicit
"verify the file exists and is non-empty" step. The model is instructed
to stamp the exact ownership marker (session+project) and record the
source revision (git rev-parse HEAD), binding the handoff to a revision.
Tests: existing buildOrderText case extended for proposal framing; three new
disposable, sandboxed (ECC_AGENT_DATA_HOME) ownership cases — missing-identity
same-named projects with a pre-existing destination that survives byte-for-byte,
foreign-owned destination disambiguated, same-owner destination reused. Full
suite 4765/4765 serial.