Skip to content

Commit 7815ed0

Browse files
committed
fix(tooling): preserve immutable transfers and identify archive roots
1 parent 837a3d1 commit 7815ed0

10 files changed

Lines changed: 230 additions & 29 deletions

‎docs/DEVELOPMENT.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ The preparer never fetches, commits, pushes or creates a release/tag.
6161
original notices against pinned byte identities. It performs no download or
6262
execution. [Sources, terms and update procedure](VENDORED-SKILLS.md) apply when
6363
using or changing those references; the full gate includes its drift checks.
64+
Source hashes identify actual working bytes. A Git archive can have different
65+
text line endings from a Windows working tree while retaining the same committed
66+
content. Record the Git revision/tree and each environment's hash separately.
67+
Doctor requires metadata belonging to its own root; an archive inside another
68+
checkout reports unavailable Git metadata instead of inheriting the parent branch.
6469
`npm run benchmark:ui -- --history 1000 --samples 5` measures a labelled read-only
6570
chat fixture in cold browser contexts after `npm run build`. Use the same browser,
6671
viewport and parameters for comparison; it never opens a retained user store.

‎docs/FIRST-RUN.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ deterministic; a fresh Commons workspace has no completed model tasks.
66

77
## Start and inspect without a model
88

9+
A source archive can also build and run after `npm ci`. Without its own `.git`,
10+
Doctor reports unavailable Git metadata even inside another checkout; it still
11+
checks dependencies, build and service health. Keep the installed source and
12+
its runtime data in their own directory. See [the checked archive installation](WORKFLOW-MEASUREMENTS.md#clean-public-source-archive).
13+
914
1. Install Node.js 24.11 or newer within Node 24, npm and Git. Run `npm ci`,
1015
`npm run doctor`, then `npm run dev` in the cloned repository.
1116
2. Open `http://127.0.0.1:4173/`. Use **Repositories**, **Pull requests** and

‎docs/HANDOFF-2026-10-19.md‎

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ tracks dated decisions and receipts; this file is the operational entry point.
88
## Repositories and state
99

1010
- Working repository: `X:\ai-github`, branch `codex/development-foundation`,
11-
latest fully checked local commit `0343698` at this checkpoint. The local data and model
11+
latest fully checked local commit `f9739c5` at this checkpoint. The local data and model
1212
installation are here. Recheck status before acting; this file can age.
1313
- Public repository: [antropos17/commit-zero](https://github.com/antropos17/commit-zero),
14-
`main` at `e98812f13dbacfe756688593da938bfdd0cc108f` after a normal push.
14+
`main` at `837a3d156b103434d4e6ca8458a064389e70861a` after a normal push.
1515
Its separate checkout is `.cache/publication`. The histories are unrelated;
16-
the public tree matches local `0343698` (`6869892b52c417c9561264ac5242e27336501b7d`).
17-
Vendored-reference provenance repair is the next bounded unit.
16+
the public tree matches local `f9739c5` (`5285458b975f262f7fa16cbccb9e28b8e89cd535`).
17+
Installation/transfer recovery is the next bounded unit.
1818
Do not merge histories, reset the local branch or force push. Recheck remote
1919
before publishing anything else.
20-
- Public CI [run 39258238673](https://github.com/antropos17/commit-zero/actions/runs/39258238673)
21-
passed all three jobs for `e98812f`. Local
20+
- Public CI [run 39262630426](https://github.com/antropos17/commit-zero/actions/runs/39262630426)
21+
passed all three jobs for `837a3d1`. Local
2222
`evidence:status` confirmed equal trees and current full/browser receipts. The
2323
preceding retry-fixture failure at `5f9f88e` is preserved in the mission log.
2424
- This mission has not run local or hosted model inference, spawned product
@@ -44,7 +44,10 @@ run `npm run test:ui`. The browser suite starts disposable in-memory services.
4444

4545
Preserve `runtime/database`, `runtime/identity`, `runtime/backups`, `.env`,
4646
`runtime/verification` and `runtime/local-model`. The normal gateway at 4173
47-
was offline during this pass. The installed Qwen file's digest was checked without
47+
was started at the user's explicit request near 13:54 UTC and passed gateway
48+
and all three service health checks. Its supervisor PID is 26764; the visible
49+
in-app browser opened Discover at `http://127.0.0.1:4173/` and stays open.
50+
No model or agent was started. The installed Qwen file's digest was checked without
4851
loading the model; inference capability was not verified. UI health reads are separate from model
4952
execution, and no model-backed job was started. The existing Commons run
5053
`49092854-f9bd-4b7a-8d12-4ac5ea0e5f70` has an approved **unmerged** Safe
@@ -108,8 +111,21 @@ upstream snapshots; four original license/NOTICE files are preserved separately.
108111
`npm run skills:verify` checks that offline identity without executing a tool.
109112
[Sources and update procedure](VENDORED-SKILLS.md) and
110113
`shared/vendored-skills.json` carry exact provenance. Four targeted fixtures and
111-
the 38-test tooling suite passed; the new 106-test frozen full gate and 56-case
112-
Chrome suite remain required before publishing this unit.
114+
the 38-test tooling suite passed, followed by the 106-test frozen full gate and
115+
56-case Chrome suite. The published tree and exact CI passed. Its staging
116+
summary reported an uncertain final working-copy check: four new immutable
117+
notices had CRLF working bytes despite correct staged blobs. Those bytes were
118+
preserved, proven CRLF-only and reconciled to the committed originals. No reset
119+
or history rewrite occurred. The current bounded fix disables apply-time
120+
autocrlf per command and checks immutable working bytes directly against blobs.
121+
Actual same-patch replays and a corruption-rejection fixture verify the repair.
122+
123+
A clean archive of public `837a3d1` installed 226 fresh packages, built/served,
124+
matched all vendored identities and passed three Chrome first-run/recovery cases.
125+
The archive's Doctor exposed parent Git identity leakage. Doctor now requires
126+
its own metadata and checks the resolved checkout root; the actual archive and
127+
the minimal regression fixture correctly report unavailable Git metadata.
128+
[Installation scope and receipts](WORKFLOW-MEASUREMENTS.md#clean-public-source-archive).
113129

114130
The account unit separates successful authentication from saved-list
115131
loading. `AccountProvider` scopes reads to the active identity and invalidates
@@ -239,10 +255,10 @@ The anonymous-session regression caught by the first full run is fixed; the
239255
signed-out selected-author case now passes in the isolated five-case group.
240256
Full 56-case Chrome and frozen full gates passed for this published unit.
241257

242-
- Latest local frozen full gate at `0343698`: 102/102 Node tests, compiled DOM/axe
258+
- Latest local frozen full gate at `f9739c5`: 106/106 Node tests, compiled DOM/axe
243259
2/2, build and static serving passed. Stable source hash
244-
`efd251cd546d3e9773ab52ec4d6d48703d5a9f3cbbca576d3504d8a0a7e9354d`;
245-
receipts `runtime/verification/commons-saved-agents-{full,browser}-corrected-2026-10-19.json`
260+
`4ce8e54955603f1d622dec3a4aaf21c285abee51ab96a4794cbbeceb8fa6a33f`;
261+
receipts `runtime/verification/vendored-skills-{full,browser}-2026-10-19.json`
246262
(ignored by Git).
247263
- Installed Chrome browser suite passed 47/47 at desktop and 390px. Real captures
248264
are `runtime/verification/commons-first-run-{desktop,narrow}-2026-10-19.png`,
@@ -313,7 +329,7 @@ Full 56-case Chrome and frozen full gates passed for this published unit.
313329

314330
## Next work, in order
315331

316-
1. Complete vendored-reference provenance: run grouped Chrome and `npm run check` on frozen source,
332+
1. Complete installation/transfer recovery: run grouped Chrome and `npm run check` on frozen source,
317333
commit it, use `publication:prepare` dry run/explicit staging in the separate
318334
checkout, compare Git trees, commit/push without force and inspect public CI.
319335
Record exact SHA and receipt.

‎docs/MISSION-2026-10-19.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ Start: 03:46:17 UTC. Deadline: 15:46:17 UTC. Final integration reserve begins 14
1212

1313
## Current action
1414

15-
Qualify the vendored-reference identity and license repair, publish its checked source, then verify a clean public-source archive installation without retained stores or inference. Consolidate the operational handoff and final evidence afterwards. Current implementation baseline is local `0343698` / public `e98812f`, full 102 Node / 2 DOM / 56 Chrome checks and exact public CI passed. Keep new profiles disabled and protect the integration reserve beginning 14:16:17 UTC.
15+
Finish the bounded installation/transfer fixes, freeze and verify all source, then consolidate final handoff and evidence. Current checked baseline is local `f9739c5` / public `837a3d1`, 106 Node / 2 DOM / 56 Chrome and exact public CI passed. The normal local app was explicitly started and opened at the user request; keep it running without inference. Begin final integration by 14:16:17 UTC; deadline 15:46:17 UTC.
1616

1717
## Decisions and limits
1818

1919
- This pass makes no model calls and never launches product agents. Existing real inference history remains historical evidence only.
2020
- Scenario participants, saved account configurations, and proposed catalog profiles are separate identities.
2121
- `node --check` and ordinary child processes are not an arbitrary-code sandbox. No sandbox claim will be made without an actual isolated runtime and denial/cleanup fixtures.
22-
- Initial unapproved terminal GitHub API access failed under network policy. An approved read now works: `origin/main` is still `3371395`, CI succeeded there, and repository description/topics are already populated. Publication must still preserve the separate public history and pass a fresh source check.
22+
- At mission startup, terminal GitHub access needed the approved network route. The initial checked public commit was `3371395`; later publications and their exact evidence are dated below. Recheck the current remote and preserve the separate history before any new publication.
2323

2424
## Evidence log
2525

@@ -149,4 +149,10 @@ Qualify the vendored-reference identity and license repair, publish its checked
149149

150150
- Focused tooling passed 38/38 on the completed provenance source, including all four new fixtures. Immutable log/receipt: `runtime/verification/vendored-skills-tooling-2026-10-19`. All original upstream files remain unchanged; new notices are held outside the protected reference folders.
151151

152-
Freeze all source/docs for the 56-case browser suite and 106-test full Node gate. Commit, prepare/publish and inspect exact CI. Preserve the final 90-minute reserve from 14:16:17 UTC.
152+
- Licensing gates completed at 13:27:19 UTC: full 106/106 Node, 2/2 DOM/build/serve and Chrome 56/56, source-index v2 hash `4ce8e54955603f1d622dec3a4aaf21c285abee51ab96a4794cbbeceb8fa6a33f`. Stream interruptions near 13:23/13:27 and the parent's read-only authorization checkpoint interrupted implementation; there is no claim of continuous work through the gap. After the parent confirmed the actual Commit Zero source-publication permission, execution resumed at 13:42. Ordinary Windows process creation returned error 1909; the approved alternate command route works. No account or security setting was changed.
153+
- Local `f9739c5275e252a5448ce53a93d7ffdc9e74838d` retained the frozen hash after commit. Fresh fetch/dry run succeeded. Staging returned `failed` / `mutationOutcome:uncertain` after producing the exact expected tree; its unchanged failed receipt is retained. Manual staged-tree comparison and diff checks preceded ordinary public commit `837a3d156b103434d4e6ca8458a064389e70861a`, tree `5285458b975f262f7fa16cbccb9e28b8e89cd535`; CI39262630426 passed all three jobs. Subsequent working-state inspection found four newly transferred notices had CRLF bytes. Each was backed up, proven to differ only by CRLF and compared with the exact committed blob before restoring original bytes. Recovered evidence confirmed clean equal trees and current full/browser receipts. See `vendored-skills-transfer-recovery-2026-10-19.json`, preserved byte folder and `vendored-skills-evidence-recovered-2026-10-19.json`. The original failed stage was never relabeled successful.
154+
- Two disposable clones replayed the same real patch: ordinary apply produced a 1,091-byte / 21-CRLF notice, while command-scoped `core.autocrlf=false` retained the original 1,070 LF bytes. Both staged trees matched, exposing why working-byte checks are needed. Receipt `publication-attributes-replay-2026-10-19.json`. The updated preparer additionally compares every explicitly immutable working path with its staged blob. A targeted fixture checks LF and CRLF preservation, unchanged repository settings and rejection of manual corruption; both targeted transfer tests passed. The initial short and real-notice synthetic baselines did not independently reproduce the actual conversion and are retained as such; only the actual patch replay supports that claim.
155+
- A fresh archive of public `837a3d1` installed 226 packages with exit 0, matched all 93 vendored files/four notices, built, passed in-memory serving and three real Chrome first-run/recovery cases. No retained store/model was present. Receipt `clean-install-837a3d1-2026-10-19.json`, npm/browser logs, and [full scope](WORKFLOW-MEASUREMENTS.md#clean-public-source-archive). The actual archive's Doctor falsely inherited the parent branch. A minimal fixture reproduced the error; own-metadata/root validation and sanitized bounded Git reads fix it. The actual archive now returns the correct unavailable Git state when inspected by the corrected Doctor. `check:fast` passed 10/10; full acceptance remains required.
156+
- Near 13:54 UTC the parent relayed the direct user request to open the site. No normal app listeners existed, so the existing dev supervisor started hidden (PID26764). Actual loopback health passed for gateway/workspace/identity/ranking. A visible in-app browser loaded Discover at `http://127.0.0.1:4173/`, confirmed by DOM and screenshot and marked to remain open. No scenario control, task launch or model action was pressed. This explicitly requested normal runtime now opens the retained databases; earlier disposable-only and offline-runtime observations remain dated historical evidence.
157+
158+
Freeze all source/docs for the 56-case browser suite and 108-test full Node gate after focused tooling feedback. Publish the bounded recovery, then perform final handoff integration. Start no further features; preserve the final 90-minute reserve from 14:16:17 UTC.

‎docs/RELEASE.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ retained collaboration and bounded interpreted games. The separate public-lookin
77
repository scenario remains a deterministic example. It is not evidence of a
88
public agent network or autonomous adoption.
99

10+
Publication preparation uses command-scoped `core.autocrlf=false` and compares
11+
raw working bytes with staged blobs for explicitly immutable (`-text`) paths,
12+
including attributes introduced in the same patch. An uncertain mutation needs
13+
inspection of both staged and working content. Preserve unexpected bytes and
14+
reconcile only changes owned by that operation; never reset to hide a failure.
15+
1016
| Section | Implemented behavior | Acceptance boundary |
1117
| --- | --- | --- |
1218
| Projects | Create game/library, search/filter, independent fork, archive/restore, JSON and Git-history export | Up to 40 projects per workspace; no remote Git push/pull server |

‎docs/WORKFLOW-MEASUREMENTS.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,40 @@ or normal user database write was part of these measurements.
66

77
## Feedback loop
88

9+
### Clean public source archive
10+
11+
On 2026-10-19, public `837a3d156b103434d4e6ca8458a064389e70861a` was
12+
archived and extracted into a new workspace-local directory with no `.git`,
13+
`node_modules`, retained store or model. Archive SHA-256:
14+
`56f289a37757db3a3b62e03d8b2b6396dda7c9a6bcc6959044300b0927b1c167`.
15+
`npm ci --cache X:/ai-github/.cache/npm-install-2026-10-19 --no-audit --no-fund`
16+
installed 226 packages with exit 0. The cache and dependency directory were new;
17+
this is one installation observation, not a timing comparison or speedup.
18+
19+
`source:inspect`, `skills:verify`, production build and in-memory `test:serve`
20+
passed. Three actual Chrome first-run/recovery cases passed from that archive's
21+
own installed dependencies and disposable services. No retained stores or model
22+
were present. Receipt `runtime/verification/clean-install-837a3d1-2026-10-19.json`
23+
and npm/browser logs retain the exact scope. The archive's 443-file, 10,643,905-byte
24+
working-source hash was `1312ad7b8e0ddb7adaea299cd15c5a5df4addffa4ff790089746b251a12c70b8`.
25+
It differs from the Windows maintainer working hash because Git normalizes text;
26+
archive/commit identity and environment-specific byte hashes remain separate.
27+
28+
The install exposed Doctor inheriting the parent checkout's branch. A minimal
29+
source-only fixture failed before the fix; metadata now must belong to the actual
30+
root and inherited Git overrides are cleared for the bounded reads. The corrected
31+
Doctor also reported unavailable Git metadata against the actual archive. These
32+
checks do not turn the archive into an independent security sandbox.
33+
34+
A separate actual-patch replay exposed CRLF conversion when an immutable notice
35+
and its attributes arrived together. The original replay produced 1,091 bytes /
36+
21 CRLFs for a 1,070-byte LF notice; command-scoped `core.autocrlf=false` preserved
37+
the exact 1,070 bytes. Both produced the intended Git tree, so tree checks alone
38+
missed the dirty working bytes. The preparer now directly compares immutable
39+
working files with staged blobs. The targeted fixture tests LF/CRLF preservation
40+
and refuses explicit byte corruption without changing the repository's settings.
41+
All recovery bytes from the original transfer were preserved before correction.
42+
943
### Maintainer transfer friction and reproducible preparation
1044

1145
Repeated mission publications used handwritten path-copy/stage/tree-compare

‎scripts/doctor.mjs‎

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
import { readFile, access, statfs, stat } from "node:fs/promises";
1+
import {
2+
readFile,
3+
access,
4+
statfs,
5+
stat,
6+
lstat,
7+
realpath,
8+
} from "node:fs/promises";
29
import { execFileSync } from "node:child_process";
310
import { resolve } from "node:path";
411
import { fileURLToPath } from "node:url";
5-
import { walk } from "./project-files.mjs";
12+
import { walk, gitEnvironment } from "./project-files.mjs";
613

714
export function localBase(value) {
815
const url = new URL(value);
@@ -77,16 +84,28 @@ export async function diagnose({
7784
`${freeGB.toFixed(1)} GB free on the workspace volume`,
7885
);
7986
try {
80-
const status = execFileSync("git", ["status", "--porcelain=v1", "-z"], {
81-
cwd: root,
82-
encoding: "utf8",
83-
windowsHide: true,
84-
});
85-
const branch = execFileSync("git", ["branch", "--show-current"], {
86-
cwd: root,
87-
encoding: "utf8",
88-
windowsHide: true,
89-
}).trim();
87+
const marker = await lstat(resolve(root, ".git"));
88+
if (marker.isSymbolicLink() || (!marker.isDirectory() && !marker.isFile()))
89+
throw new Error("No ordinary local Git metadata.");
90+
const git = (args) =>
91+
execFileSync(
92+
"git",
93+
["-c", `safe.directory=${root}`, "-C", root, ...args],
94+
{
95+
encoding: "utf8",
96+
windowsHide: true,
97+
timeout: 8000,
98+
env: gitEnvironment(),
99+
stdio: ["ignore", "pipe", "pipe"],
100+
},
101+
);
102+
if (
103+
(await realpath(git(["rev-parse", "--show-toplevel"]).trim())) !==
104+
(await realpath(root))
105+
)
106+
throw new Error("Git metadata belongs to another checkout.");
107+
const status = git(["status", "--porcelain=v1", "-z"]);
108+
const branch = git(["branch", "--show-current"]).trim();
90109
record(
91110
"Git",
92111
"ok",

0 commit comments

Comments
 (0)