| 1 | # Changed files facts |
| 2 | |
| 3 | Branch changes/facts starts at origin/main 18fb5be4 in its own physical TMPDIR |
| 4 | worktree. Slice 5b is excluded: no diff endpoint, contents, or native diff view. |
| 5 | No new GET route or performance exemption is needed. |
| 6 | |
| 7 | ## Report and device contract |
| 8 | |
| 9 | The controller approved ProtocolChangeFiles = 31 on 2026-11-26. The separate |
| 10 | optional change_files field carries Engineering presentation facts on |
| 11 | StepReport and the device Step. Existing wire.ChangeFacts, Review measurement, |
| 12 | acceptFacts and merge authority are unchanged. |
| 13 | |
| 14 | Facts bind the accepted step's base and candidate. Entries contain only path, |
| 15 | status (added/modified/deleted/renamed), old path for a rename, additions, |
| 16 | deletions and a binary flag. MaxChangeEntries is 200; encoded facts are also |
| 17 | bounded to 96 KiB. Totals cover the complete scan, including omitted entries; |
| 18 | truncated means entries were omitted. Each raw/numstat listing is bounded to |
| 19 | 1 MiB. A failed, malformed, mismatched or clipped scan supplies no facts, |
| 20 | rather than invented totals. Paths retain spaces and Unicode; invalid/control |
| 21 | paths are refused. No file contents, tokens, or new network calls are added. |
| 22 | |
| 23 | Engineering measures its local candidate/base pair during publication, including |
| 24 | republish. It reuses Review's NUL-safe raw and numstat parsers. A first commit |
| 25 | with no base is measured only after proving it is a root commit; a missing base |
| 26 | on a later commit remains unknown. Review retains its existing handling. |
| 27 | |
| 28 | The additive chat_steps.change_files column stores only accepted Engineering |
| 29 | facts. Attempt and runner authority use the existing report path; acceptance |
| 30 | also checks protocol, role, specialist, exact base/candidate and bounds. The |
| 31 | device projection validates stored facts again and hides them while the step |
| 32 | is no longer done. Task-read visibility is inherited unchanged. Encode removes |
| 33 | change_files below protocol 31. Older runners remain usable; native links out. |
| 34 | |
| 35 | The OpenAPI schema includes the optional field, entry statuses, nonnegative |
| 36 | counts and the 200-entry limit. The full native task fixture round-trips the |
| 37 | new nested field. A runner-to-device contract covers protocol 31 and protocol |
| 38 | 30, exact mapping, and the absence of merge-authority/private fields. |
| 39 | |
| 40 | ## Native presentation and copy |
| 41 | |
| 42 | Changed files selects the last Engineering step for the task's current |
| 43 | candidate, with matching facts SHA/base. Missing, invalid or older facts keep |
| 44 | the existing web link. The bounded list shows per-file counts and status, |
| 45 | renames with the old path, and non-text files. Lists longer than ten entries |
| 46 | group by folder. Empty totals remain real zeroes only when the scan completed. |
| 47 | |
| 48 | File taps build the known Amadan repository page with fixed host and ref/path |
| 49 | query parameters, then use the existing allowlisted opener. Amadan's actual |
| 50 | route was verified in its local internal/hub/browse_render.go. Candidate SHA |
| 51 | pins ordinary files; deleted files use the base. Spaces, Unicode, plus signs, |
| 52 | query delimiters and fragments are encoded as path data. Non-Amadan repository |
| 53 | identifiers and traversal paths cannot construct a file URL. iPhone uses the |
| 54 | existing Safari sheet; Mac uses the default browser. |
| 55 | |
| 56 | Luna approved native.changes.* on 2026-11-26: |
| 57 | - added: Added |
| 58 | - modified: Changed |
| 59 | - deleted: Deleted |
| 60 | - renamed: Renamed |
| 61 | - binary: Non-text file |
| 62 | - renamed_from: Renamed from %@ |
| 63 | - truncated: Showing the first %lld files. Open on Amadan for the full list. |
| 64 | - total: %lld files, %lld lines added, %lld removed |
| 65 | |
| 66 | Both generated catalogs carry the review comment. Catalog substitutions |
| 67 | pluralize files and lines independently. The checker verifies that the ordinary |
| 68 | plural forms still match the reviewed English source. Native tests pin |
| 69 | "1 file, 1 line added, 0 removed" and all singular/plural combinations. Compact |
| 70 | row counts stay numeric; their accessibility label uses the reviewed plural |
| 71 | phrases. |
| 72 | |
| 73 | ## Test-first and authority proof |
| 74 | |
| 75 | Initial commands, with GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0: |
| 76 | - go test ./internal/runner/thin -run |
| 77 | 'TestEngineeringChangeFiles|TestChangeFilesBounds' -count=1: |
| 78 | red for missing API, then green. Real git tests cover spaces, Unicode, |
| 79 | rename, deletion, non-text data and 203 files bounded to 200. |
| 80 | - go test ./internal/wire -run 'TestProtocol31|TestChangeFilesValidation': |
| 81 | red for missing protocol/field, then green. A frozen main StepReport key set |
| 82 | strictly rejects the new field in every downgraded protocol 1 through 30. |
| 83 | - go test ./internal/equipo/chat -run |
| 84 | '^TestEngineeringChangeFilesAcceptance': |
| 85 | red for missing acceptance/storage/projection, then green. |
| 86 | - go test ./internal/runner/thin -run '^TestChangeFilesInitialCommit$' -count=1: |
| 87 | red (nil facts) before the proven-root path, then green. |
| 88 | - swift test --package-path native/apple --filter ChangeFilesTests: |
| 89 | red for missing decoding/presentation APIs, then green. |
| 90 | |
| 91 | A detached worktree of clean main 18fb5be4 captured sixty Review gate decisions: |
| 92 | fifteen input cases at protocols 27, 28, 30 and 31. Cases cover approval, |
| 93 | checks, hold, size, binary/special/signing changes, gate files, shortened review, |
| 94 | missing/incomplete evidence, ask policy and a person's decision. The frozen |
| 95 | testdata/presentation-gate.json is compared byte for byte by |
| 96 | TestPresentationFactsLeaveReviewGateUnchanged on this branch. It passes. |
| 97 | A separate real-git test also compares Review facts and its decision before |
| 98 | and after collecting display facts. The detached worktree was removed. |
| 99 | |
| 100 | Additional focused commands pass: |
| 101 | - go test ./internal/thintest -run '^TestContractEngineeringChangeFiles$' -count=1 |
| 102 | - go test ./internal/equipo/mergegate ./internal/runner/thin ./internal/wire |
| 103 | ./internal/plan3test -run |
| 104 | 'TestPresentationFactsLeaveReviewGateUnchanged|TestSandboxMasksPublish|TestProtocol31|TestPersonAPIDeviceContract' |
| 105 | -count=1 |
| 106 | - go test ./internal/equipo -run |
| 107 | 'TestMigrationModels|TestConversationMigrationSnapshot' -count=1 |
| 108 | - swift test --package-path native/apple --filter |
| 109 | 'ChangeFilesTests|TaskDetailTests.fullWire' |
| 110 | |
| 111 | ## Mutations |
| 112 | |
| 113 | Scripts changes-facts-mutate-go.py and changes-facts-mutate-native.py run one |
| 114 | mutation at a time, require an actual test assertion failure (not a compile |
| 115 | error), and restore the source in finally. All 43 are killed. |
| 116 | |
| 117 | Server/runner (23): downgrade boundary; wire entry bound; wire byte bound; |
| 118 | wire exact totals; truncation consistency; runner entry bound; runner byte |
| 119 | bound; clipped scan; ancestor requirement; proven root requirement; matching |
| 120 | raw/numstat paths; additions; binary flag; rename old path; publication mapping; |
| 121 | acceptance protocol; role; specialist; base; candidate; device step state; |
| 122 | device mapping; persistent storage. |
| 123 | |
| 124 | Native (20): current candidate; latest matching step; Engineering specialist; |
| 125 | done state; facts SHA; facts base; valid facts; folder grouping; repository |
| 126 | shape; file path; deleted-file base ref; plus encoding; count argument order; |
| 127 | entry bound; byte bound; truncation consistency; binary counts; duplicate paths; |
| 128 | server slash escaping; server HTML escaping. |
| 129 | |
| 130 | The first current-candidate mutation survived because the old step fixture |
| 131 | still carried the new candidate's facts. The fixture now binds that old |
| 132 | measurement to its own candidate. The mutation then fails, as do all others. |
| 133 | The clipped-scan fixture ends the bounded prefix exactly on a valid raw record, |
| 134 | so ignoring clipping cannot pass merely because a parser rejects a partial row. |
| 135 | |
| 136 | ## Validation and evidence |
| 137 | |
| 138 | Go build, vet, staticcheck v0.7.0, govulncheck, copy release, references, lanes, |
| 139 | formatting, spacing, gitleaks and migration checks pass. Vet and staticcheck |
| 140 | target linux/amd64, as instructed for macOS toolproxy compatibility. The size |
| 141 | gate first reported the expected added lines; existing package exemptions now |
| 142 | record the exact measured source/test sizes and the scope that added them. |
| 143 | The corrected budget gate passes. No timing budget was increased. |
| 144 | |
| 145 | native/scripts/check-native.sh passes: 325 tests in 42 suites, one existing |
| 146 | known issue, 327 byte-identical web strings, references, Mac and iOS Simulator |
| 147 | builds. The eight new native entries retain Luna's approved wording. |
| 148 | |
| 149 | Two TaskViewUI tests pass on an iPhone 18 Pro / iOS 27 simulator: the list and |
| 150 | old-runner fallback, and accessibility extra-large text. Screenshots from this |
| 151 | branch are in polish-audit/equipo-daily-driver/site/build/slice5/: |
| 152 | - iphone-changed-files.png |
| 153 | - iphone-changed-files-large.png |
| 154 | - iphone-changed-files-old-runner.png |
| 155 | - mac-changed-files.png |
| 156 | |
| 157 | The Mac capture uses the built debug app and the same offline fixture transport. |
| 158 | Both platforms retain the existing pinned decision. The screenshots were |
| 159 | inspected; paths wrap at large text sizes. The fixture app and simulator were |
| 160 | closed and the temporary simulator removed. |
| 161 | |
| 162 | Main c74fd0ac (landed Needs you) was merged normally before publishing. String |
| 163 | conflicts keep both reviewed catalogs; existing size exemptions include the |
| 164 | merged done_at mapping and tests. Final results are recorded below; the exact-head |
| 165 | Linux verdict is saved in the screenshot validation directory. |
| 166 | |
| 167 | Final self-review added a test-first JSON byte-bound regression: Swift normally |
| 168 | escapes slashes, whereas Go leaves them literal and escapes HTML characters. |
| 169 | Native now measures the server's snake-case JSON representation with the same |
| 170 | escaping. A valid 200-entry nested-path listing is accepted, while a shorter |
| 171 | HTML-character listing over the server's byte bound is rejected. The test |
| 172 | failed both assertions before the fix; removing either encoding rule is killed |
| 173 | by changes-facts-mutate-json.py. The seven focused ChangeFiles tests pass. |
| 174 | |
| 175 | Final native gate after the main merge and byte-bound fix passes: 350 tests in |
| 176 | 46 suites, one existing known issue, 330 web-parity strings, Mac and Simulator |
| 177 | builds. Post-merge budget, formatting and focused device/runner contract tests |
| 178 | also pass. Post-commit runner-dead-references passes. |
| 179 | |
| 180 | The full local macOS `make test` is not green: toolproxy requires unix.O_PATH, |
| 181 | browser tests have no Chromium, and existing runner/provider checks fail. |
| 182 | Representative TestOnboardingClaudeHeadlessBrowserLogin and |
| 183 | TestPublishCoreAuthorizationContract failures were reproduced unchanged on |
| 184 | clean origin/main c74fd0ac in a detached worktree, then that worktree was removed. |
| 185 | No platform bypass or test weakening was added. Linux hub CI is the final gate; |
| 186 | its full result is archived beside the screenshots in validation/ci-final.json. |
| 187 | |
| 188 | Local `make perf` runs TestPerfScreens and TestPerfBoot, but the target fails |
| 189 | while building the same Linux-only toolproxy dependency (`unix.O_PATH`). The |
| 190 | Linux CI performance target must pass; no performance exemption was added. |
| 191 | The validation directory preserves both local failure logs and all passing |
| 192 | focused, mutation, native and screenshot-test logs for review. |
| 193 | |
| 194 | The first final-head Linux run (4d654482) exposed three wire contract omissions: |
| 195 | TestInjectionProtocolDowngrade still expected 30 when negotiating 99; |
| 196 | TestEnumsAreTheWireConstants needed the ChangedFile status constant family; |
| 197 | and TestConnectionTypesCarryNoSecrets needed exact exceptions for |
| 198 | ChangedFile.path and ChangedFile.old_path. These are validated repository-relative |
| 199 | names; the audit still rejects every other secret-shaped field. The status |
| 200 | values now use shared wire constants. All `go test ./internal/wire/...` tests |
| 201 | pass after the fixes. The failed CI log is retained as ci-4d654482-failed.json; |
| 202 | the subsequent exact-head verdict is in ci-final.json. |
| 203 | |
| 204 | ## Fable review follow-up, 2026-11-26 |
| 205 | |
| 206 | The device detail read now opts into file facts when building the view. |
| 207 | Ordinary task and step projections omit them, including the Coordinator tool, |
| 208 | lists, snapshots, events and action responses. GET /tasks/{id} uses TaskDetail, |
| 209 | with the same current-member and task-read authorization as Task. The OpenAPI |
| 210 | field description and schema generator explicitly say detail only. |
| 211 | |
| 212 | The new 45-file, three-round fixture first failed on every ordinary projection |
| 213 | and on the Coordinator's clipped JSON. After the change, the complete tool |
| 214 | answer decodes and retains both verdict=approve and needs_you=merge. The |
| 215 | runner-to-device contract also checks that /tasks and /snapshot omit facts, |
| 216 | while detail retains them for protocol 31 and omits them for older runners. |
| 217 | |
| 218 | Go and native share internal/wire/testdata/change-paths.json. Both reject Cc, |
| 219 | U+200E/F, U+202A–202E and U+2066–2069, and accept other format characters, |
| 220 | including a ZWJ emoji filename. Invalid facts are rejected by the existing |
| 221 | acceptance validation before storage. Native validates the optional field at |
| 222 | decode or assignment and discards invalid facts without losing the task; |
| 223 | rendering no longer repeats the validation and JSON byte measurement. Legacy |
| 224 | payloads and valid facts still round-trip. |
| 225 | |
| 226 | Test-first commands and results: |
| 227 | |
| 228 | - GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test ./internal/wire ./internal/equipo/chat ./internal/runner/thin -run 'TestChangeFiles|TestChangePath' -count=1 |
| 229 | failed before implementation: bidi paths accepted, invalid facts accepted |
| 230 | for storage, ordinary projections leaked facts, Coordinator JSON truncated. |
| 231 | Runner guard regression cases passed before mutation. |
| 232 | - swift test --package-path native/apple --filter ChangeFilesTests |
| 233 | failed before implementation: ZWJ rejected, bidi accepted, invalid |
| 234 | decoded/assigned facts retained. All 10 tests passed after implementation. |
| 235 | - The focused final Go run includes wire, chat, runner/thin, thintest and |
| 236 | plan3test, matching ChangeFiles, ChangePath, EngineeringChangeFiles, |
| 237 | ContractEngineeringChangeFiles, PersonAPIDeviceContract and |
| 238 | OpsAreWhatTheHandlersWrite. All pass after merging main. |
| 239 | |
| 240 | All 27 follow-up mutations were killed by assertion failures, then restored: |
| 241 | |
| 242 | - Go validation: absolute path, backslash, invalid UTF-8, binary line counts, |
| 243 | candidate and base commit length, binaries greater than files, Cc characters, bidi characters. |
| 244 | - Server projection: acceptance validation removed; default task view includes |
| 245 | facts; detail opt-in removed; HTTP detail calls ordinary Task; active and |
| 246 | retired step opt-in guards removed. |
| 247 | - Runner: final validation removed; commit-pattern guard removed; type-change |
| 248 | mapping removed; non-Engineering publication includes facts. |
| 249 | - Native: empty/leading path segments, Cc characters, backslash, old-path |
| 250 | validation, bidi characters, decode validation, assignment validation and |
| 251 | repository-name pattern removed. |
| 252 | |
| 253 | The executable mutation script, exact commands, exit statuses and per-mutation |
| 254 | logs are saved in site/build/slice5/validation/review/. Run it from the worktree |
| 255 | as python3 facts-review-mutations.py wire chat contract runner and |
| 256 | python3 facts-review-mutations.py native, plus |
| 257 | python3 facts-review-mutations.py extra-wire extra-chat. It restores each source |
| 258 | after testing. The 45-file fixture includes one retired round as well as two |
| 259 | active rounds, so both step collections are covered. |
| 260 | |
| 261 | Live link verification: curl -sI |
| 262 | 'https://amadan.net/oficina/equipo?ref=main&path=go.mod' returned HTTP/2 200 on |
| 263 | 2026-11-26. A GET returned the go.mod file viewer and its module line, not a |
| 264 | repository listing or sign-in page. The existing /namespace/repo?ref=&path= |
| 265 | shape is correct; the native tests retain commit-pinned refs and plus escaping. |
| 266 | |
| 267 | Main 7c113ac8 was merged normally in e0eeee7a. This includes the landed composer |
| 268 | and merge-credential fixes. The native parity gate found main's two new reviewed |
| 269 | stop reasons, work.reason.merge_credential and work.reason.amadan_unreachable; |
| 270 | both were copied exactly from the web catalog (Paul's existing approval). |
| 271 | No new wording or copy question was introduced. Measured size records cover the |
| 272 | new projection/guard tests and the merged main changes; no timing budget changed. |
| 273 | |
| 274 | |
| 275 | Final native gate passes: 356 tests in 47 suites, one existing known issue, |
| 276 | 332 web-parity strings, Mac build and iOS Simulator build. Linux-targeted |
| 277 | make build and make vet pass with GOTOOLCHAIN=go1.26.11, CGO_ENABLED=0, |
| 278 | GOOS=linux and GOARCH=amd64. Staticcheck v0.7.0 and govulncheck pass using |
| 279 | make staticcheck / make govulncheck with their go-run -exec wrapper setting |
| 280 | GOOS=linux GOARCH=amd64 for the analyser. Formatting, spacing, copy release, |
| 281 | lane coverage, migration, measured size and gitleaks checks pass. |
| 282 | |
| 283 | The ordinary macOS make build and make perf hit the existing Linux-only |
| 284 | toolproxy dependency (unix.O_PATH). TestPerfScreens and TestPerfBoot themselves |
| 285 | passed; the full Linux hub gate remains authoritative. No platform bypass, |
| 286 | new route or performance exemption was added. |
| 287 | |