Skip to content

Commit 842b483

Browse files
Merge pull request #3 from Factory-AI/dev
VFS Right-Thing Restructure: five-crate workspace, correctness fixes, semantic unification
2 parents 059bd52 + 5286249 commit 842b483

468 files changed

Lines changed: 139254 additions & 94929 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Final Mission Attestation — VFS Right-Thing Restructure
2+
3+
Machine-readable definition-of-done record tying the full honest gate and the
4+
codex benchmark contract to the exact commit (VAL-GATE-012, VAL-CROSS-012).
5+
6+
## Attested commit
7+
8+
- Commit: `230c30a6f2e7184b0578eb2dec087b79c0f78078` (`dev`)
9+
- Binary: `target/release/agentfs` built from that commit by `scripts/gate.sh`
10+
(release workspace build; `rust-toolchain.toml` nightly)
11+
- Runner: `Linux 7.1.2-3-cachyos x86_64 GNU/Linux`; toolchain
12+
`cargo 1.97.0-nightly (4f9b52075 2026-05-01)`
13+
- Attestation artifacts: `full-gate.json` (gate + shell suite + phase8 + canon +
14+
pjdfstest + cross-surface flows), `medians.json` (benchmark contract),
15+
`bench-milestones.json` (per-milestone BENCH record, VAL-GATE-015)
16+
17+
## Full gate (all green)
18+
19+
`scripts/gate.sh` at the attested commit: fmt, clippy `--workspace
20+
--all-targets -D warnings`, `cargo test --workspace`, release build, strict
21+
shell suite (`AGENTFS_GATE_STRICT=1 crates/agentfs-cli/tests/all.sh`, both
22+
corruption-torture transport legs), `phase8-validation.py --smoke` (noopen /
23+
flush / external-base-drift coherence harnesses run inside it), and
24+
`scripts/validation/consistency-canon.sh`. Result: exit 0 —
25+
`PASS=24 SKIP=0 FAIL=0`, phase8 `failed_gates: []`, canon all rules PASS.
26+
Full detail: `full-gate.json`.
27+
28+
pjdfstest: `scripts/validation/posix/run-pjdfstest.sh --profile phase5-ci
29+
--agentfs-bin target/release/agentfs` — PASS (311 tests, run standalone at the
30+
attested commit).
31+
32+
## Benchmark contract
33+
34+
Exact invocation (library/perf-contract.md, services.yaml `bench-multi`):
35+
36+
```bash
37+
python3 scripts/validation/git-workload-benchmark-multi.py \
38+
--label m7-opt-sandbox-bringup-repeat --iterations 5 --warmup 1 \
39+
--agentfs-bin "$PWD/target/release/agentfs" \
40+
--output <out.json> --keep-iterations \
41+
--source .agents/benchmarks/fixtures/codex \
42+
--read-files 64 --read-bytes 4096 --edit-files 8
43+
```
44+
45+
Baseline: the ACTIVE post-M3 baseline
46+
`.agents/benchmarks/restructure-baseline/medians.json` (recorded at
47+
`2b811f0`, orchestrator-signed rebaseline; the archived M1 artifact is
48+
`medians-m1.json`). Gate rule: a phase is red iff its median regresses >5%
49+
relative AND >10ms absolute.
50+
51+
Result (median-of-5 per phase, all 7 phases in band, `all_phases_passed: true`
52+
in `medians.json`):
53+
54+
| phase | baseline (ms) | current (ms) | delta | verdict |
55+
| --- | ---: | ---: | ---: | --- |
56+
| checkout | 56.7 | 56.9 | +0.4% | OK |
57+
| clone | 2800.9 | 2882.8 | +2.9% | OK |
58+
| diff | 65.6 | 25.9 | -60.6% | OK |
59+
| edit | 5.0 | 4.9 | -1.6% | OK |
60+
| fsck | 215.0 | 177.9 | -17.2% | OK |
61+
| read_search | 8.8 | 8.0 | -8.6% | OK |
62+
| status | 178.0 | 145.8 | -18.1% | OK |
63+
64+
Provenance: the official quiet-window candidate/sentinel pair plus the
65+
mandated brittle-phase repeat was recorded at `dae8aa6` (feature
66+
m7-opt-sandbox-bringup; the same-window sentinel of the baseline binary was
67+
green, and the first candidate run's clone red evaporated on the repeat per
68+
the perf-contract brittle-phase rule). The pair is cited at the attested
69+
commit per the orchestrator round-3 ruling: the only commit after `dae8aa6`
70+
(`230c30a`, darwin seatbelt read scoping) changes `cfg(target_os = "macos")`
71+
code, docs, and clap help text only — Linux binary perf semantics are
72+
unchanged. Raw run JSONs (`bench-cand.json`, `bench-cand-repeat.json`,
73+
`bench-sent.json`, with per-iteration walls) live in the mission evidence dir
74+
`evidence/m7-cli-docs/m7-opt-sandbox-bringup/`.
75+
76+
The earlier attestation-round checkout reds (rounds 1-2, bisected to
77+
`ea416c8`) were closed with zero code change: the tax was the user's PATH
78+
git-ai shim taking a slow path inside the run-sandbox namespace, removed by
79+
`dae8aa6`'s universal /usr/bin/git pinning. Full history:
80+
`bench-milestones.json` M7 rows and library/perf-contract.md "M7 checkout red
81+
— CLOSED".
82+
83+
## Per-milestone BENCH record (VAL-GATE-015)
84+
85+
Every BENCH-flagged milestone held the band; the stored-artifact reds that
86+
occurred along the way (M2 fsck, M3 clone/fsck, M4a checkout/clone, M7
87+
checkout) were each adjudicated per the procedure in
88+
library/perf-contract.md — the M2-M4a set as ambient drift via same-window
89+
sentinel reruns of the baseline code (leading to the orchestrator-signed
90+
post-M3 rebaseline), and the M7 checkout red as the unpinned git-ai shim,
91+
closed by harness/sandbox git pinning with an all-green pair at `dae8aa6`.
92+
Full per-milestone table with sources: `bench-milestones.json`.
93+
94+
## Cross-surface flows
95+
96+
All flows executed end-to-end at the attested commit against the release
97+
binary (30/30 checks OK; transcript `cross-surface5.log` in the mission
98+
evidence dir, summary in `full-gate.json.cross_surface_flows`):
99+
100+
- clone -> mount -> git workflow -> unmount -> remount persistence
101+
(VAL-CROSS-001/002): clean clone status, `cross-persist` commit and hash
102+
stable across remount.
103+
- moved single DB file reopens (VAL-CROSS-003): exactly one file in the DB
104+
family, `mv` + `integrity --json` + remount all green.
105+
- sandboxed run leaves the host untouched (VAL-CROSS-004): before/after host
106+
census identical outside `.agentfs/run/cross-host`.
107+
- run writes visible via `agentfs fs` (VAL-CROSS-005) and the session recorded
108+
in `agentfs timeline` (VAL-CROSS-006).
109+
- mounted-FS and fs-CLI writes mutually visible byte-exact (VAL-CROSS-013).
110+
- combined kill-switch leg noopen=0 noflush=0 uring=0 (VAL-CROSS-011):
111+
create/append/fsync/unlink-while-open/git all green, remount verified,
112+
integrity clean.
113+
114+
## File-size cap census (VAL-CONS-006)
115+
116+
Binding rule (architecture.md section 7): no production file over 2,500 lines
117+
of NON-TEST CODE; sibling `tests.rs` files are excluded. The gate-enforced
118+
census (`consistency-canon.sh` line-count-cap, cfg(test)-aware, comment/blank
119+
stripping) reports zero offenders at the attested commit. For the audit trail,
120+
the three files whose RAW line counts exceed 2,500 are all under the cap by
121+
the binding rule:
122+
123+
| file | raw lines | non-test code lines |
124+
| --- | ---: | ---: |
125+
| crates/agentfs-fuse/src/adapter/mod.rs | 3073 | 2213 |
126+
| crates/agentfs-nfs/src/server/nfs_handlers.rs | 3827 | 2354 |
127+
| crates/agentfs-cli/src/cmd/migrate.rs | 2546 | 1144 |
128+
129+
## Notes
130+
131+
- `.agents/benchmarks/restructure-baseline/attestation` is a symlink to this
132+
directory for the mission feature's expected path.
133+
- Benchmark runs were serialized on this machine per the perf contract; load
134+
at each accepted run start is recorded in the run logs.
135+
- All gate/flow harnesses pin `/usr/bin/git` with a hookless temp-HOME git
136+
config (AGENTS.md universal-pinning rule); the post-run daemon census was
137+
clean.
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
{
2+
"record": "Per-milestone BENCH compliance (VAL-GATE-015)",
3+
"contract": "library/perf-contract.md: median-of-5 per phase via git-workload-benchmark-multi.py; red iff >5% relative AND >10ms absolute vs the active baseline; single runs never gate; serialized on a quiet machine.",
4+
"baselines": {
5+
"m1": {
6+
"artifact": ".agents/benchmarks/restructure-baseline/medians-m1.json",
7+
"recorded_at_commit": "ae1e13f (benchmarked), 809d684 (artifact commit)",
8+
"status": "archived; superseded by the post-M3 rebaseline after three independent drift adjudications proved it brittle on this machine for diff/fsck/clone/checkout"
9+
},
10+
"active_post_m3": {
11+
"artifact": ".agents/benchmarks/restructure-baseline/medians.json",
12+
"recorded_at_commit": "2b811f03493e861e5a7786592d25ac73b39e1aba",
13+
"recorded_at": "2026-07-04T01:14:37Z",
14+
"authorized_by": "orchestrator sign-off for misc-a-bench-rebaseline",
15+
"provenance": ".agents/benchmarks/restructure-baseline/provenance-post-m3.md"
16+
}
17+
},
18+
"milestones": [
19+
{
20+
"milestone": "M2 (dead-surface)",
21+
"runs": [
22+
{
23+
"source": "m2-perf-triage-bench-red (HEAD 4e37c41, 2026-07-03)",
24+
"verdict": "in band after adjudication",
25+
"detail": "Stored-M1 compare red on fsck (+20.6ms/+11.0%; repeat +23.7ms/+12.7%). Rebuilt baseline code ae1e13f was red against its OWN stored artifact under identical conditions (diff +37.5%, fsck +11.5%), proving ambient drift, not a HEAD regression. Adjudication accepted by M2 scrutiny (PASS) and recorded in library/perf-contract.md."
26+
}
27+
]
28+
},
29+
{
30+
"milestone": "M3 (config/telemetry)",
31+
"runs": [
32+
{
33+
"source": "m3-telemetry-registry feature BENCH",
34+
"verdict": "in band (0 red phases)",
35+
"detail": "checkout -18.0%, clone -9.7%, diff -53.7%, edit -3.9%, fsck -0.9%, read_search +1.9%, status -7.6%."
36+
},
37+
{
38+
"source": "M3 user-testing VAL-CONF-013 (HEAD bc1753f)",
39+
"verdict": "in band after adjudication",
40+
"detail": "Moving red set across two stored-artifact runs (run1 clone +5.1%/fsck +8.3%; run2 diff/fsck/status); rebuilt ae1e13f sentinel red against its own artifact (clone +7.9%/+241ms, fsck +8.3%); direct HEAD-vs-sentinel showed HEAD equal or faster on the stored-red phases. Adjudicated noise; led to the orchestrator-signed post-M3 rebaseline (misc-a)."
41+
},
42+
{
43+
"source": "misc-a-bench-rebaseline (post-M3 2b811f0)",
44+
"verdict": "baseline re-recorded",
45+
"detail": "Accepted run pair agreed 0-red in both directions; current-HEAD confirmation vs the new baseline: 0 red phases."
46+
}
47+
]
48+
},
49+
{
50+
"milestone": "M4a (core hot path)",
51+
"runs": [
52+
{
53+
"source": "m4a-store-extraction feature BENCH",
54+
"verdict": "in band (0 red phases)",
55+
"detail": "checkout -14.2%, clone +2.2%, diff -41.5%, edit +1.0%, fsck +4.7%, read_search -9.5%, status -15.9%."
56+
},
57+
{
58+
"source": "m4a-batcher-split feature BENCH (HEAD a687a84)",
59+
"verdict": "in band after adjudication",
60+
"detail": "Stored compare red on checkout/clone; rebuilt 2b811f0 sentinel equally red vs the same stored artifact under the same load; direct candidate-vs-sentinel: checkout +3.9ms, clone +3.9%, edit -0.8ms. Adjudicated ambient drift per perf-contract."
61+
},
62+
{
63+
"source": "M4a user-testing VAL-CORE-008 (HEAD 9454886, load ~3.9)",
64+
"verdict": "in band (0 red phases)",
65+
"detail": "bench-compare exit 0; edit 5.2ms vs 5.0ms baseline (+3.8%, +0.2ms)."
66+
}
67+
]
68+
},
69+
{
70+
"milestone": "M4b (schema/overlay)",
71+
"runs": [
72+
{
73+
"source": "m4b-overlay-directoryize feature BENCH",
74+
"verdict": "in band (0 red phases)",
75+
"detail": "bench-compare exit 0, 7 within band."
76+
},
77+
{
78+
"source": "m4b-overlay-partial-store feature BENCH",
79+
"verdict": "in band (0 red phases)",
80+
"detail": "checkout +9.4ms stayed below the >10ms absolute red threshold; all other phases faster than baseline."
81+
},
82+
{
83+
"source": "m4b-agentfs-directoryize feature BENCH",
84+
"verdict": "in band (0 red phases)",
85+
"detail": "clone -641.5ms / -22.9%; all other phases OK."
86+
},
87+
{
88+
"source": "M4b user-testing VAL-CORE-018 (HEAD a62b0a1, load ~1.9-2.5)",
89+
"verdict": "in band (0 red phases)",
90+
"detail": "clone 2800.9ms -> 2741.3ms (-2.1%); diff +6.8ms and read_search +1.6ms sub-10ms absolute."
91+
}
92+
]
93+
},
94+
{
95+
"milestone": "M5 (crate split)",
96+
"runs": [
97+
{
98+
"source": "m5-fuse-crate feature BENCH",
99+
"verdict": "in band (0 red phases)",
100+
"detail": "checkout 49.0ms, clone 2037.0ms, diff 31.1ms, edit 4.4ms, fsck 157.6ms, read_search 7.2ms, status 142.2ms."
101+
},
102+
{
103+
"source": "m5-mount-crate feature BENCH",
104+
"verdict": "in band (0 red phases)",
105+
"detail": "checkout 43.1ms, clone 1872.2ms, diff 42.4ms, edit 3.7ms, fsck 180.3ms, read_search 7.7ms, status 121.1ms."
106+
},
107+
{
108+
"source": "m5-fix-base-drift-coherence feature BENCH",
109+
"verdict": "in band (0 red phases)",
110+
"detail": "All candidate medians faster than the active baseline (checkout 50.1ms, clone 1879.4ms, diff 33.2ms, edit 3.0ms, fsck 169.8ms, read_search 6.5ms, status 118.5ms)."
111+
}
112+
]
113+
},
114+
{
115+
"milestone": "M6 (semantics)",
116+
"runs": [
117+
{
118+
"source": "m6-fix-readdir-scaling feature BENCH",
119+
"verdict": "in band (0 red phases)",
120+
"detail": "checkout 54.6ms, clone 2605.7ms, diff 33.1ms, edit 4.5ms, fsck 206.4ms, read_search 8.1ms, status 172.3ms; bench-compare 0 red, 7 within band."
121+
}
122+
]
123+
},
124+
{
125+
"milestone": "M7 (cli/docs + attestation)",
126+
"runs": [
127+
{
128+
"source": "m7-attestation round 1 (HEAD ff91302, quiet load 1.4-2.1)",
129+
"verdict": "red (checkout) — superseded by the round-3 closure",
130+
"detail": "Stored compare red on checkout only (56.7 -> 133.5ms, +135%); same-window sentinel did NOT clear it (sentinel 70.3ms vs HEAD 133.5ms), so it could not be adjudicated as noise; all other phases in band or faster. Deferred to a wall-time bisect."
131+
},
132+
{
133+
"source": "m7-attestation round 2 wall-time bisect (HEAD 5535368, quiet load 2.0-3.5)",
134+
"verdict": "red reproduced; bisected to ea416c8 — superseded by the round-3 closure",
135+
"detail": "Checkout red reproduced (104.5ms vs same-window sentinel 77.2ms). Median-of-5 wall bisect c1937a3..3669c7b in a detached worktree, alternating probe order: first bad commit ea416c8 (scope run reads; fork before tokio). Checkout-phase FUSE profile counters identical parent-vs-culprit, locating the tax in the run-sandbox environment, not the FUSE hot path. Round 2 also established the brittle-phase repeat rule after a first-run diff red (+45%) evaporated on repeat."
136+
},
137+
{
138+
"source": "m7-opt-sandbox-bringup closure (HEAD dae8aa6, quiet load 3.4-4.2)",
139+
"verdict": "in band (0 red phases) — checkout red CLOSED with zero code change",
140+
"detail": "Root cause: the bisect-era workload ran PATH git = the ~/.git-ai/bin/git shim inside the sandbox namespace; ea416c8's namespace pushed the shim's daemon/state logic onto a slow path per git call. dae8aa6 pins /usr/bin/git through the sandbox and harnesses, removing the tax from both legs. Official candidate/sentinel pair plus mandated brittle-phase repeat vs the stored post-M3 baseline: repeat 0 red, all 7 phases in band (checkout 56.7 -> 56.9ms +0.4%, clone +2.9%; the first candidate run's clone +24.3% red evaporated on the repeat). Same-window sentinel green; candidate checkout beat the sentinel by 17%. Exact-bench-shape zone attribution showed no measurable sandbox cost on any variant. Evidence: evidence/m7-cli-docs/m7-opt-sandbox-bringup/, library/perf-contract.md CLOSED entry."
141+
},
142+
{
143+
"source": "m7-attestation final (attested HEAD 230c30a)",
144+
"verdict": "in band (0 red phases, cited pair)",
145+
"detail": "medians.json records the dae8aa6 official repeat pair vs the active post-M3 baseline: all 7 phases passed (checkout +0.4%, clone +2.9%, every other phase faster than baseline). Cited at 230c30a per the orchestrator round-3 ruling: the only commit after dae8aa6 changes cfg(target_os=macos) code, docs, and clap help text only — Linux binary perf semantics unchanged."
146+
}
147+
]
148+
}
149+
]
150+
}

0 commit comments

Comments
 (0)