Skip to content

Commit a279303

Browse files
committed
docs: finalize PR 1196 review record
1 parent 071f4dc commit a279303

2 files changed

Lines changed: 34 additions & 23 deletions

File tree

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

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
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: `908be9cabb2b552c56cbd86537fbccb86ea5e0b2`
6+
- Final code candidate: `071f4dc782e70bb4a0f63397902a4285d0156903`
77
- Mode: full Council review plus final independent remediation pass
88
- Local verdict: **PASS**
9-
- Remote status: final commits still need to be pushed and fresh CI/bot review must finish
9+
- Remote gate: the final candidate must be pushed and fresh CI/bot review must finish
1010

1111
## Decision
1212

@@ -20,7 +20,7 @@ PDF accounting is intentionally approximate. The user selected a parser-free pol
2020
PDF allowance = max(32,768, decoded inline payload bytes)
2121
```
2222

23-
Remote URLs and provider file IDs receive the fixed allowance. Exact page expansion and tokenization remain provider-authoritative. The Council did not require exact PDF parsing because adding a parser would create a new document-processing/resource boundary without making provider token accounting exact.
23+
Remote references and provider file IDs receive the fixed allowance when the part is identifiable as a PDF. An untyped provider file ID cannot be classified locally and receives the generic 16,384-token file allowance instead. Exact page expansion and tokenization remain provider-authoritative. The Council did not require exact PDF parsing because adding a parser would create a new document-processing/resource boundary without making provider token accounting exact.
2424

2525
## Original Council gate
2626

@@ -44,7 +44,11 @@ Post-Council review found and repaired:
4444
- small-model output floors above the model's own reservation;
4545
- safety-margin loss near the context boundary;
4646
- non-JSON provider-option loss during reasoning reconciliation;
47-
- raw PDF page-marker trust.
47+
- raw PDF page-marker trust;
48+
- provider-normalized Mistral/Devstral bridge messages missing from the estimate;
49+
- generated system prompts counted even when workflows omit them or OAuth routes them through instructions;
50+
- identical system and instruction values being deduplicated despite occupying two wire fields; and
51+
- a static bridge assertion that could match the unclamped property-access form.
4852

4953
Each repair was centralized in the shared output-budget module or the existing pure media projection, then exercised through both request boundaries.
5054

@@ -61,40 +65,45 @@ Batching the same parser would not remove its decompression/traversal boundary.
6165

6266
## Final independent remediation review
6367

64-
Two independent live Council seats re-reviewed exact head `908be9cabb` after the parser removal.
68+
Two independent live Council seats re-reviewed the request-shape correction at `c78e1a61b6`, then received the final `c78e1a61b6..071f4dc782` delta after fresh bot findings. The final delta makes the estimator more conservative and does not change PDF behavior.
6569

6670
### Feynman seat — PASS
6771

68-
- Verified exact final head.
72+
- Verified exact final code head `071f4dc782`.
6973
- Confirmed `pdf-lib`, async parsing, page regex/policy, and transitive lock entries are absent.
7074
- Confirmed lazy estimation is not evaluated when `maxOutputTokens` is omitted.
71-
- Confirmed both request boundaries clamp after headers, tools, instructions, and media projection are finalized.
72-
- Re-ran provider, native, stream, typecheck, diff, and strict marker checks successfully.
75+
- Confirmed Mistral/Devstral projection matches the transport normalizer without mutating history.
76+
- Confirmed workflow/OAuth prompt routing matches the fields actually sent.
77+
- Confirmed identical system/instruction values are counted as two wire occurrences while omitted system fields remain excluded.
78+
- Confirmed the tightened bridge regex rejects `params.maxOutputTokens` and accepts the clamped shorthand.
79+
- Re-ran provider, typecheck, diff, and bridge checks successfully.
7380

7481
### Musashi seat — PASS
7582

76-
- Confirmed the parser experiment is cleanly reverted.
77-
- Confirmed the final code differs from the last pre-parser safe candidate only in the explicit parser-free comment and test naming.
78-
- Confirmed synchronous lazy estimation and parity across both callers.
79-
- Confirmed dependency cleanup, focused tests, typecheck, and diff checks pass.
83+
- Verified exact final code head `071f4dc782`.
84+
- Confirmed the parser experiment remains cleanly reverted and no PDF dependency returned.
85+
- Confirmed synchronous lazy estimation, linear Mistral projection, and parity across both callers.
86+
- Confirmed identical wire fields are counted separately while OAuth/workflow omissions are not double-counted.
87+
- Confirmed the fixed-width bridge lookbehind runs correctly under Bun.
88+
- Confirmed focused tests, typecheck, and diff checks pass.
8089

8190
### Degraded seat
8291

8392
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.
8493

85-
Consensus therefore rests on two independent live PASS votes, the primary review, the complete changed-file inspection, and a sealed zero-finding Codex Security remediation scan. The degraded seat is disclosed rather than silently counted as agreement.
94+
Consensus therefore rests on two independent live PASS votes on exact final code head `071f4dc782`, the primary review, the complete changed-file inspection, and sealed zero-finding Codex Security scans. The degraded seat is disclosed rather than silently counted as agreement.
8695

8796
## Final verification
8897

89-
- Focused provider, AI-SDK stream, native request, and upstream bridge suites: **413 passed, 11 skipped, 1 existing todo, 0 failed**.
98+
- Focused provider, AI-SDK stream, native request, and upstream bridge suites: **416 passed, 11 skipped, 1 existing todo, 0 failed**.
9099
- Repository typecheck: **13/13 successful**.
91100
- Strict changed-file marker validation: passed.
92101
- Required-marker inventory: **35/35**.
93102
- Frozen lockfile install: **1,295 installs across 1,390 packages, no changes**.
94-
- Targeted oxlint: **212 warnings, 0 errors**.
103+
- Targeted oxlint on the final supplemental files: **161 warnings, 0 errors**; warnings are existing repository debt.
95104
- Prettier: all changed files pass except `provider/provider.ts` and `provider/transform.ts`; both fail identically on `origin/main`.
96105
- `git diff --check origin/main...HEAD`: passed.
97-
- Final Codex Security remediation scan: complete coverage, **0 findings**.
106+
- Final request-shape Codex Security scans `1dcbce9e-587e-4495-94ff-6d3291e5e1d6` and `bfa1cc4a-7d87-463d-8fc9-822e1624f8b1`: complete coverage, **0 findings**.
98107

99108
## Residual limitations
100109

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

Lines changed: 9 additions & 7 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: `908be9cabb2b552c56cbd86537fbccb86ea5e0b2`
6+
- Final code candidate: `071f4dc782e70bb4a0f63397902a4285d0156903`
77
- Scan mode: chained immutable branch-diff reviews
88
- Final coverage: complete
99
- Findings remaining on the final candidate: **0**
@@ -16,7 +16,7 @@ The final candidate removes local PDF parsing entirely. PDF media now uses a del
1616
max(32,768 tokens, decoded inline payload bytes)
1717
```
1818

19-
Remote URLs and provider file IDs receive the fixed 32,768-token allowance. The estimate is monotonic in locally observable payload size, ignores untrusted page metadata, and does not decompress or traverse PDF structure. The configured provider remains authoritative for exact tokenization and for unusually compact or dense documents.
19+
Remote references and provider file IDs receive the fixed 32,768-token allowance when the part is identifiable as a PDF. An untyped provider file ID cannot be classified locally and receives the generic 16,384-token file allowance instead. The estimate is monotonic in locally observable payload size, ignores untrusted page metadata, and does not decompress or traverse PDF structure. The configured provider remains authoritative for exact tokenization and for unusually compact or dense documents.
2020

2121
This is the selected product boundary, not an attempt at exact PDF accounting. A compact or dense PDF can still be underestimated locally and rejected by the provider. That residual is an acknowledged reliability limitation; it is not a local parser, authorization, confidentiality, integrity, or shared-service vulnerability.
2222

@@ -31,8 +31,10 @@ The review used immutable ranges so every material repair was independently reco
3131
| Marker fix | `ac7346e767` | Removed lexical page-marker trust |
3232
| Structural parser experiment | `ac7346e767..858c7b1dab` | Two validated Low findings; experiment rejected |
3333
| Parser-free remediation | `858c7b1dab..908be9cabb` | Complete coverage; **0 findings** |
34+
| Final request-shape fixes | `5e04c7885d..c78e1a61b6` | Complete coverage; **0 findings** |
35+
| Instruction occurrence fix | `c78e1a61b6..071f4dc782` | Complete coverage; **0 findings** |
3436

35-
The final remediation scan was sealed once as scan `80591880-0a17-454c-b312-92c32a38f5ff`. Its authoritative result contains six reviewed surfaces, no deferred work, no open question, and zero findings.
37+
The parser-free remediation scan was sealed once as scan `80591880-0a17-454c-b312-92c32a38f5ff`. The final request-shape scans were sealed once each as `1dcbce9e-587e-4495-94ff-6d3291e5e1d6` and `bfa1cc4a-7d87-463d-8fc9-822e1624f8b1`. Their authoritative results contain no deferred work, no open question, and zero findings.
3638

3739
## Findings discovered and resolved
3840

@@ -60,7 +62,7 @@ Both production request paths use the same sequence:
6062

6163
1. Finalize messages, tools, provider instructions, headers, and plugin-selected output reservation.
6264
2. If no output reservation or credible limit exists, return without serializing the prompt.
63-
3. Lazily estimate text, schemas, semantic media allowances, and decoded inline payload size.
65+
3. Lazily estimate text, schemas, semantic media allowances, decoded inline payload size, and every system/instruction wire occurrence.
6466
4. Enforce a dedicated input limit when declared.
6567
5. Clamp the output reservation against the shared context window with a safety margin.
6668
6. Reconcile fixed reasoning budgets with the final reservation.
@@ -70,19 +72,19 @@ Codebase graph tracing found exactly two production callers of the centralized c
7072

7173
## Verification
7274

73-
- Focused provider, AI-SDK stream, native request, and upstream bridge suites: **413 passed, 11 skipped, 1 existing todo, 0 failed**.
75+
- Focused provider, AI-SDK stream, native request, and upstream bridge suites: **416 passed, 11 skipped, 1 existing todo, 0 failed**.
7476
- Repository typecheck: **13/13 tasks successful**.
7577
- Strict changed-file marker validation: passed.
7678
- Required-marker inventory: **35/35**.
7779
- Frozen lockfile install: **1,295 installs across 1,390 packages, no changes**.
7880
- Targeted oxlint: **0 errors**; warnings remain repository debt.
7981
- Prettier: all changed files pass except `provider/provider.ts` and `provider/transform.ts`; both fail identically at `origin/main`, so no unrelated whole-file rewrite was introduced.
8082
- `git diff --check origin/main...HEAD`: passed.
81-
- Final Codex Security remediation scan: complete, **0 findings**.
83+
- Final request-shape Codex Security scans: complete coverage, **0 findings**.
8284

8385
## Operational caveats
8486

8587
- TAC advisory was attempted once earlier in the PR workflow and was unavailable; it was not retried.
8688
- No live provider request or full interactive UI replay was performed.
8789
- Provider-side rejection remains possible for compact or unusually dense PDFs because the local estimate is intentionally crude.
88-
- The remote PR still needs the final commits pushed, current review threads reconciled, and fresh CI/bot results before a merge recommendation.
90+
- The remote PR must receive the final commits, reconcile every current review thread, and pass fresh CI/bot review before merge.

0 commit comments

Comments
 (0)