Skip to content

Commit f8552be

Browse files
committed
docs: record final media calibration review
1 parent 856f428 commit f8552be

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

‎research/code-reviews/PR 1196 Consensus Review.md‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- Repository: `AltimateAI/altimate-code`
44
- Pull request: [#1196](https://github.com/AltimateAI/altimate-code/pull/1196)
55
- Review dates: 2026-08-30 through 2026-08-31
6-
- Final code candidate: `dc24ed05559d85a5a358d116e97b9b66d536cea4`
6+
- Final code candidate: `856f428981ddc970880cb525e82aee4f974e5e5f`
77
- Mode: full Council review plus final independent remediation pass
88
- Local verdict: **PASS**
99
- Remote gate: the final candidate must be pushed and fresh CI/bot review must finish
@@ -66,9 +66,11 @@ Current `main` (`7f07b7d3b6`) was merged into the PR branch in `b2c3a3480c`. The
6666
The two remaining bot comments were addressed in `e475a2d1df` and `dc24ed0555`:
6767

6868
- Dense ASCII runs of at least 32 characters and six distinct opaque characters receive an added conservative floor. Detection is one forward pass with scalar counters and a `Set` capped at six entries, so it is linear time, constant auxiliary memory, and independent of the estimator's 400-character chunk boundaries.
69-
- Audio and video use fixed semantic allowances of 32,768 and 131,072 tokens respectively. Generic files still scale with decoded payload size, images retain the existing fixed allowance, and PDF remains parser-free at `max(32,768, decoded inline bytes)`.
69+
- Audio and video use the crude hybrid `max(8,192, ceil(decoded inline bytes / 64))`. Tiny and remote media remain usable on 16K contexts, while very large inline payloads grow monotonically instead of receiving an unbounded fixed estimate. Generic files still scale one-for-one with decoded payload size, images retain the existing fixed allowance, and PDF remains parser-free at `max(32,768, decoded inline bytes)`.
7070
- A regression sweeps all 400 possible chunk alignments for a 32-character dense token. Both independent reviewers reproduced the same conservative delta at every offset.
7171

72+
After the first push, fresh Cubic and Codex reviews exposed opposing problems with the initial fixed media constants: 131,072 tokens rejected even tiny video on supported 16K/32K models, while any fixed constant could undercount arbitrarily large inline media. Commit `856f428981` replaces those constants with the hybrid above without parsing codecs, duration, frames, or PDF structure.
73+
7274
## Why the PDF parser experiment was rejected
7375

7476
An intermediate branch attempted structural page counting with `pdf-lib`. Independent reviewers found two blockers:
@@ -84,11 +86,13 @@ Batching the same parser would not remove its decompression/traversal boundary.
8486

8587
Two independent live Council seats re-reviewed the request-shape correction at `c78e1a61b6`, the small-limit production delta through `56dbc7e9b1`, the test-fixture correction through `b7cfd659fa`, and the final system-framing correction at exact production head `d13f784786`. The last correction serializes non-empty system entries as the same array of `{ role: "system", content }` records sent by both applicable request paths. Empty arrays remain free, while OAuth and workflow paths continue to omit generated-system framing. None of these changes alter PDF behavior.
8688

87-
After reconciling `main`, the same two seats reviewed the exact final range `a0d7a4aed2..dc24ed0555`. Both returned **PASS**. Feynman independently measured a 1 MiB dense-text pass at roughly 38 ms and confirmed all 400 alignments. Musashi independently observed the same +24-token delta at every alignment and verified that equal-size generic/PDF payloads still scale by bytes while audio/video remain fixed at their semantic allowances.
89+
After reconciling `main`, the same two seats reviewed the intermediate range `a0d7a4aed2..dc24ed0555`. Both returned **PASS**. Feynman independently measured a 1 MiB dense-text pass at roughly 38 ms and confirmed all 400 alignments. Musashi independently observed the same +24-token delta at every alignment and verified that equal-size generic/PDF payloads still scaled by bytes while audio/video used the intermediate fixed allowances.
90+
91+
Both seats then reviewed `800e3b102f..856f428981` and returned **PASS** on the final hybrid media curve. They independently reproduced 8,221 tokens for tiny/remote media, 16,413 for 1 MiB, and 65,565 for 4 MiB; verified usable output remains on a 16K context; and confirmed bounded header inspection with no decoding, parsing, copying, dependency, or PDF/generic-file change. Both explicitly classified codec-dependent over/underestimation as the documented heuristic limitation rather than a blocker.
8892

8993
### Feynman seat — PASS
9094

91-
- Re-reviewed exact final head `dc24ed0555` after the `main` merge and final bot-comment repairs.
95+
- Re-reviewed post-main head `dc24ed0555` and final media-calibration head `856f428981`.
9296
- Verified exact final production code head `d13f784786`.
9397
- Confirmed `pdf-lib`, async parsing, page regex/policy, and transitive lock entries are absent.
9498
- Confirmed lazy estimation is not evaluated when `maxOutputTokens` is omitted.
@@ -109,7 +113,7 @@ After reconciling `main`, the same two seats reviewed the exact final range `a0d
109113

110114
### Musashi seat — PASS
111115

112-
- Re-reviewed exact final head `dc24ed0555` after the `main` merge and final bot-comment repairs.
116+
- Re-reviewed post-main head `dc24ed0555` and final media-calibration head `856f428981`.
113117
- Verified exact final production code head `d13f784786`.
114118
- Confirmed the parser experiment remains cleanly reverted and no PDF dependency returned.
115119
- Confirmed synchronous lazy estimation, linear Mistral projection, and parity across both callers.
@@ -129,7 +133,7 @@ After reconciling `main`, the same two seats reviewed the exact final range `a0d
129133

130134
The original chairman seat was rejected twice by the service safety filter because its retained conversation context included the earlier parser stress case. It produced no contrary code finding on the final head. The thread limit prevented replacing that retained seat with a new fourth thread.
131135

132-
Consensus therefore rests on two independent live PASS votes on exact final production head `dc24ed0555`, the primary review, the complete changed-file inspection, and sealed zero-finding Codex Security scans through the final production change. The degraded seat is disclosed rather than silently counted as agreement.
136+
Consensus therefore rests on two independent live PASS votes on exact final production head `856f428981`, the primary review, the complete changed-file inspection, and sealed zero-finding Codex Security scans through the final production change. The degraded seat is disclosed rather than silently counted as agreement.
133137

134138
## Final verification
135139

@@ -141,7 +145,7 @@ Consensus therefore rests on two independent live PASS votes on exact final prod
141145
- Targeted oxlint on the final supplemental production and provider-test files: **161 warnings, 0 errors**; warnings are existing test-file debt.
142146
- Prettier: the final supplemental files and resolved `llm.test.ts` pass.
143147
- `git diff --check`: passed.
144-
- Post-main and final boundary-hardening Codex Security scans `86b98822-70df-446e-bd56-47d7169ef98a` and `37afdb50-204e-462a-85ab-7deeafdbb2ab`: complete coverage, **0 findings**. Earlier request-shape and edge-case scans remain sealed with zero findings.
148+
- Post-main, dense-boundary, and final media-calibration Codex Security scans `86b98822-70df-446e-bd56-47d7169ef98a`, `37afdb50-204e-462a-85ab-7deeafdbb2ab`, and `5b969965-638d-42a6-bc38-d2f5d23b7dc2`: complete coverage, **0 findings**. Earlier request-shape and edge-case scans remain sealed with zero findings.
145149

146150
## Residual limitations
147151

@@ -159,7 +163,7 @@ The local recommendation is **merge after remote completion**, provided:
159163
3. fresh required CI and bot reviews are green; and
160164
4. no new critical finding appears on the pushed head.
161165

162-
Do not merge merely on the strength of checks attached to an earlier head; fresh checks must complete on `dc24ed0555` after push.
166+
Do not merge merely on the strength of checks attached to an earlier head; fresh checks must complete after the final documentation commit is pushed.
163167

164168
## Execution reliability
165169

‎research/security-reviews/PR 1196 Security Review.md‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- Repository: `AltimateAI/altimate-code`
44
- Pull request: [#1196](https://github.com/AltimateAI/altimate-code/pull/1196)
55
- Review dates: 2026-08-30 through 2026-08-31
6-
- Final code candidate: `dc24ed05559d85a5a358d116e97b9b66d536cea4`
6+
- Final code candidate: `856f428981ddc970880cb525e82aee4f974e5e5f`
77
- Scan mode: chained immutable branch-diff reviews
88
- Final coverage: complete
99
- Findings remaining on the final candidate: **0**
@@ -39,8 +39,9 @@ The review used immutable ranges so every material repair was independently reco
3939
| System-message framing fix | `cedd33a866..d13f784786` | Complete coverage; **0 findings** |
4040
| Post-main estimator repairs | `b2c3a3480c..e475a2d1df` | Complete coverage; **0 findings** |
4141
| Dense-boundary hardening | `e475a2d1df..dc24ed0555` | Complete coverage; **0 findings** |
42+
| Final media calibration | `800e3b102f..856f428981` | Complete coverage; **0 findings** |
4243

43-
The parser-free remediation scan was sealed once as scan `80591880-0a17-454c-b312-92c32a38f5ff`. The final request-shape and edge-case scans were sealed once each as `1dcbce9e-587e-4495-94ff-6d3291e5e1d6`, `bfa1cc4a-7d87-463d-8fc9-822e1624f8b1`, `19f139b0-8c4c-48cc-adca-a60d41920664`, `5111b689-e4ad-4243-a7cb-86845b30ca6d`, and `33ec5c89-fce8-434d-b8a6-2baba941ff27`. The post-main bot-comment repair and chunk-boundary hardening were sealed once each as `86b98822-70df-446e-bd56-47d7169ef98a` and `37afdb50-204e-462a-85ab-7deeafdbb2ab`. Their authoritative results contain no deferred work, no open question, and zero findings.
44+
The parser-free remediation scan was sealed once as scan `80591880-0a17-454c-b312-92c32a38f5ff`. The final request-shape and edge-case scans were sealed once each as `1dcbce9e-587e-4495-94ff-6d3291e5e1d6`, `bfa1cc4a-7d87-463d-8fc9-822e1624f8b1`, `19f139b0-8c4c-48cc-adca-a60d41920664`, `5111b689-e4ad-4243-a7cb-86845b30ca6d`, and `33ec5c89-fce8-434d-b8a6-2baba941ff27`. The post-main bot-comment repair, chunk-boundary hardening, and final media calibration were sealed once each as `86b98822-70df-446e-bd56-47d7169ef98a`, `37afdb50-204e-462a-85ab-7deeafdbb2ab`, and `5b969965-638d-42a6-bc38-d2f5d23b7dc2`. Their authoritative results contain no deferred work, no open question, and zero findings.
4445

4546
## Findings discovered and resolved
4647

@@ -84,7 +85,9 @@ Final bot review identified two estimator mismatches. High-entropy ASCII was rec
8485

8586
Dense ASCII classification now makes one forward pass over the complete serialized text, preserving run state across the 400-character token-estimator chunks. It uses fixed counters and a unique-character `Set` capped at six entries. The final security review found no superlinear scan, unbounded allocation, backtracking, execution, logging, or chunk-boundary bypass. A regression exercises every possible chunk alignment.
8687

87-
Audio and video now receive fixed conservative semantic allowances of 32,768 and 131,072 tokens. Generic files retain decoded-byte scaling, and PDF remains the selected parser-free `max(32,768, decoded inline bytes)` policy. This avoids treating a long recording's encoded byte count as if every byte were a model token while preserving conservative request admission.
88+
The first repair gave audio and video fixed semantic allowances of 32,768 and 131,072 tokens. Fresh review then found that 131,072 unconditionally rejects tiny video on supported 16K/32K contexts, while a constant can undercount arbitrarily large inline media.
89+
90+
The final candidate uses `max(8,192, ceil(decoded inline bytes / 64))` for both modalities. Tiny and remote media therefore retain an 8,192-token baseline; a 16K context still leaves a usable clamped output budget. One MiB grows to roughly 16K tokens and four MiB to roughly 65K. The calculation reuses bounded payload-size inspection and introduces no decoding, codec/duration/frame parsing, traversal, proportional allocation, fetch, logging, or dependency. Generic files retain one-token-per-decoded-byte scaling, and PDF remains the selected parser-free `max(32,768, decoded inline bytes)` policy.
8891

8992
## Final trust and data flow
9093

@@ -110,7 +113,7 @@ Codebase graph tracing found exactly two production callers of the centralized c
110113
- Targeted oxlint: **0 errors**; warnings remain repository debt.
111114
- Prettier: final supplemental files and the resolved merge-conflict test pass.
112115
- `git diff --check`: passed.
113-
- Final post-main scans through `dc24ed0555`: complete coverage, **0 findings**.
116+
- Final post-main scans through `856f428981`: complete coverage, **0 findings**.
114117

115118
## Operational caveats
116119

0 commit comments

Comments
 (0)