Skip to content

test(cli): temporary Windows diagnostic for rollback, do not merge - #893

Closed
blafourcade wants to merge 12 commits into
nextfrom
diag/windows-rollback
Closed

blafourcade wants to merge 12 commits into
nextfrom
diag/windows-rollback

Conversation

@blafourcade

Copy link
Copy Markdown
Contributor

Jetable, à supprimer dès lecture. Seul le job cli / Windows compte.

blafourcade and others added 11 commits September 15, 2026 19:35
Project cleanup could delete machine-owned plugin files or native refs that another project still uses. Record canonical ownership and refuse uncertain machine cleanup.

Refs #829

AIDD-Session-Id: 01a080fc-b4fe-78d3-9317-8d5ea071ca46
Codex task environments expose CODEX_THREAD_ID ahead of the simulated Claude anchor. Clear it only in the two Claude-anchored checks so the test reads the intended session.

AIDD-Session-Id: 01a080fc-b4fe-78d3-9317-8d5ea071ca46
Project install and clean must not take over pre-existing user-scope plugins, native catalogue sources, or foreign host refs. Preserve project claims until local cleanup succeeds, and require current source/ref proof before host mutation.

This is a partial draft candidate: the framework mutation floor remains pending.

Refs #829

AIDD-Session-Id: 01a080fc-b4fe-78d3-9317-8d5ea071ca46
Prove ownership boundaries and refusal preservation through public behavior rather than weakening the mutation gate.

Framework mutation: 93.5837% against the unchanged 93% floor. Functional suite: 6700 passing tests.

Refs #829

AIDD-Session-Id: 01a080fc-b4fe-78d3-9317-8d5ea071ca46
Resolve symlink and realpath fault keys consistently on Windows. Check the correct Copilot removal contract when its binary is absent and preserve native refusal witnesses when present.

Reject malformed Codex source listings without inferring absence and retain actionable diagnostics. Mutation floors and production behavior remain unchanged.

Refs #829

AIDD-Session-Id: 01a080fc-b4fe-78d3-9317-8d5ea071ca46
Resolve only symlink lookup keys, retaining virtual project and target identities. Reproduce the drive-qualified lookup and identity-preservation contracts without changing production code.

Codex mutation consolidation passes at 95.4248% with zero timeouts; 274 focused tests pass. Refs #829

AIDD-Session-Id: 01a080fc-b4fe-78d3-9317-8d5ea071ca46
The three Windows failures were in the assertions, not in the code they
cover. Two cache-warning expectations spelled a path POSIX while the source
builds it with `join`, so they only ever matched on a platform whose
separator is a slash — one `it.each` line, played twice. The neighbour-list
expectation compared `listAll()`, whose keys the in-memory adapter
normalizes to a single spelling by design, against a key built with `join`.

Both sides now use the same builder, so they agree on either platform by
construction rather than by luck. No production behaviour changed and no
refusal assertion was relaxed.

Refs #829

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPREgkoNtK4PYh2YyZbztq
AIDD-Session-Id: 2261efcd-a873-4e60-9893-2217f702bde2
On Windows `resolve` prefixes the current drive, so the source wrote the
rebuilt settings to `D:/project/.claude/settings.json` while the test seeded
and read `/project/.claude/settings.json` — two different files in the
in-memory double. The rebuild was happening all along; every assertion was
looking somewhere else.

Ten failing cases in `marketplace-sync-recovery-contract` came from that one
key. Verified on the CI Windows job, the only Windows available: a throwaway
branch carried a deliberately failing case that dumped the separator, the
roots, the resolved path and every key the double held. Local simulation
cannot reach it — aliasing `node:path` to win32 breaks the test helpers
before the code under test.

Refs #829

AIDD-Session-Id: 2261efcd-a873-4e60-9893-2217f702bde2
The last Windows failure was the fixture, not the code. The source compares
the directory it would register — read back through `realpath`, which
resolves — against the one the host reports, taken raw. The two agree
everywhere the root already carries a drive, which every real Windows
install does; they diverge only under a drive-less fixture root like
`/user-cache`, where `resolve` adds the current drive to one side alone.

So the host now reports what a host would hold: the resolved directory. The
rollback refusal, the legitimate update and the pre-migration migration all
keep their outcomes, because those turn on which directory is named, not on
how it is spelled.

Deliberately not touched: the comparison in `marketplace-sync-settings-use-case`.
Canonicalizing both sides there would be defensible, but it is plugin
provenance — the code #829 is about — and no evidence yet says a real
install can reach the mismatch.

Refs #829

AIDD-Session-Id: 2261efcd-a873-4e60-9893-2217f702bde2
…tored it"

This reverts commit 6b3d45e.

AIDD-Session-Id: 2261efcd-a873-4e60-9893-2217f702bde2
Not for merge. The previous attempt fixed one scenario and broke three,
because three separate places in the fixture carry a path spelling and only
two were changed. This dumps, for all four scenarios at once, what Windows
actually makes of each spelling.

Delete this branch once read.

AIDD-Session-Id: 2261efcd-a873-4e60-9893-2217f702bde2
…s spelling

`realpath` answers in one spelling and a host stores another. The sync write
path compared the two with `===`, so on Windows a catalogue the host already
follows was never recognised and got registered again — the fourth scenario
of the rollback refusal, red since the suite first ran there.

The CI Windows job was the only way to see it. A throwaway branch dumped all
four scenarios at once: `realpath` returned `/user-cache/cache/built/1.0.0/…`
where the host held `\user-cache\cache\built\1.0.0\…`. Same directory, two
spellings, never equal. On posix they coincide, which is why no developer
machine ever showed it.

`samePath` folds what a case-insensitive filesystem folds, and only there: a
backslash separates on win32 and is an ordinary character in a name
everywhere else. `pathContainsOrEquals` already normalised separators for
containment; this is the equality half, and the two comparison sites in the
sync write path now use it.

An earlier attempt fixed this in the fixture instead and broke three
scenarios, because three places there carry a spelling and only two were
changed. The defect is in the comparison, not in the decor.

Refs #829

AIDD-Session-Id: 2261efcd-a873-4e60-9893-2217f702bde2
@blafourcade

Copy link
Copy Markdown
Contributor Author

Diagnostic lu. Cause : realpath répond en slashes, l'hôte stocke en antislashs, et la source comparait les deux avec ===. Correctif porté sur #870 (bfe19fac) : nouvel helper samePath dans kernel/paths.ts, utilisé aux deux sites de comparaison. Branche jetable supprimée.

@blafourcade
blafourcade deleted the diag/windows-rollback branch September 20, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants