|
| 1 | +# PR 1196 Consensus Review |
| 2 | + |
| 3 | +- Repository: `AltimateAI/altimate-code` |
| 4 | +- Pull request: [#1196](https://github.com/AltimateAI/altimate-code/pull/1196) |
| 5 | +- Review dates: 2026-08-30 through 2026-08-31 |
| 6 | +- Final code candidate: `908be9cabb2b552c56cbd86537fbccb86ea5e0b2` |
| 7 | +- Mode: full Council review plus final independent remediation pass |
| 8 | +- Local verdict: **PASS** |
| 9 | +- Remote status: final commits still need to be pushed and fresh CI/bot review must finish |
| 10 | + |
| 11 | +## Decision |
| 12 | + |
| 13 | +PR #1196 is locally merge-ready under the selected product scope. |
| 14 | + |
| 15 | +The feature prevents avoidable provider failures by reserving output only after the real request shape is known. The final code budgets system text, messages, finalized tool schemas, provider instructions, semantic media, dedicated input ceilings, context-expansion headers, and fixed reasoning options at both production request boundaries. |
| 16 | + |
| 17 | +PDF accounting is intentionally approximate. The user selected a parser-free policy: |
| 18 | + |
| 19 | +```text |
| 20 | +PDF allowance = max(32,768, decoded inline payload bytes) |
| 21 | +``` |
| 22 | + |
| 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. |
| 24 | + |
| 25 | +## Original Council gate |
| 26 | + |
| 27 | +The first three-round Council unanimously rejected the pre-repair candidate and required five concrete fixes: |
| 28 | + |
| 29 | +1. Enforce `model.limit.input` as a hard estimated-input ceiling. |
| 30 | +2. Count every semantic media occurrence conservatively, including URL-backed and AI SDK v6 tool-result variants. |
| 31 | +3. Reconcile fixed reasoning budgets with every defined final output reservation. |
| 32 | +4. Distinguish repeated aliases from true cycles so repeated schemas/media are counted per transport occurrence. |
| 33 | +5. Add behavioral proof that both AI SDK and native request paths send finalized tools, clamped output, and reconciled reasoning together. |
| 34 | + |
| 35 | +All five are present in the final branch with focused regressions. |
| 36 | + |
| 37 | +## Additional review findings |
| 38 | + |
| 39 | +Post-Council review found and repaired: |
| 40 | + |
| 41 | +- request-header precedence drift around the Anthropic 1M context flag; |
| 42 | +- unsupported-media estimation before canonical projection; |
| 43 | +- media-looking ordinary text being discounted as binary content; |
| 44 | +- small-model output floors above the model's own reservation; |
| 45 | +- safety-margin loss near the context boundary; |
| 46 | +- non-JSON provider-option loss during reasoning reconciliation; |
| 47 | +- raw PDF page-marker trust. |
| 48 | + |
| 49 | +Each repair was centralized in the shared output-budget module or the existing pure media projection, then exercised through both request boundaries. |
| 50 | + |
| 51 | +## Why the PDF parser experiment was rejected |
| 52 | + |
| 53 | +An intermediate branch attempted structural page counting with `pdf-lib`. Independent reviewers found two blockers: |
| 54 | + |
| 55 | +- the fixed 100-page/500 KB policy still undercounted valid many-page requests on supported 1M-context models; |
| 56 | +- compressed object streams could expand substantially in-process before request admission, while the input gate bounded only compressed bytes. |
| 57 | + |
| 58 | +The parser experiment was reverted. The dependency and transitive lock entries are absent from the final tree, estimator APIs are synchronous again, and tests describe the fixed allowance as parser-free. |
| 59 | + |
| 60 | +Batching the same parser would not remove its decompression/traversal boundary. A subagent is useful for development review, but it is not a runtime memory, CPU, or trust boundary. The smallest safe scope is therefore the crude local estimate plus provider enforcement. |
| 61 | + |
| 62 | +## Final independent remediation review |
| 63 | + |
| 64 | +Two independent live Council seats re-reviewed exact head `908be9cabb` after the parser removal. |
| 65 | + |
| 66 | +### Feynman seat — PASS |
| 67 | + |
| 68 | +- Verified exact final head. |
| 69 | +- Confirmed `pdf-lib`, async parsing, page regex/policy, and transitive lock entries are absent. |
| 70 | +- 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. |
| 73 | + |
| 74 | +### Musashi seat — PASS |
| 75 | + |
| 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. |
| 80 | + |
| 81 | +### Degraded seat |
| 82 | + |
| 83 | +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. |
| 84 | + |
| 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. |
| 86 | + |
| 87 | +## Final verification |
| 88 | + |
| 89 | +- Focused provider, AI-SDK stream, native request, and upstream bridge suites: **413 passed, 11 skipped, 1 existing todo, 0 failed**. |
| 90 | +- Repository typecheck: **13/13 successful**. |
| 91 | +- Strict changed-file marker validation: passed. |
| 92 | +- Required-marker inventory: **35/35**. |
| 93 | +- Frozen lockfile install: **1,295 installs across 1,390 packages, no changes**. |
| 94 | +- Targeted oxlint: **212 warnings, 0 errors**. |
| 95 | +- Prettier: all changed files pass except `provider/provider.ts` and `provider/transform.ts`; both fail identically on `origin/main`. |
| 96 | +- `git diff --check origin/main...HEAD`: passed. |
| 97 | +- Final Codex Security remediation scan: complete coverage, **0 findings**. |
| 98 | + |
| 99 | +## Residual limitations |
| 100 | + |
| 101 | +- Compact or dense PDFs can be underestimated locally and rejected by the provider. |
| 102 | +- Exact tokenizer parity across providers is not claimed. |
| 103 | +- No live request was made against every provider/context combination. |
| 104 | +- Broader tokenizer calibration and document-ingestion architecture belong in follow-up work, not this PR. |
| 105 | + |
| 106 | +## Merge gate |
| 107 | + |
| 108 | +The local recommendation is **merge after remote completion**, provided: |
| 109 | + |
| 110 | +1. the final commits are pushed without overwriting concurrent remote work; |
| 111 | +2. every review thread is answered or resolved against the new head; |
| 112 | +3. fresh required CI and bot reviews are green; and |
| 113 | +4. no new critical finding appears on the pushed head. |
| 114 | + |
| 115 | +Do not merge merely on the strength of the stale green checks attached to `9039a178c0`. |
| 116 | + |
| 117 | +## Execution reliability |
| 118 | + |
| 119 | +- Intended panel seats: 3 |
| 120 | +- Final live PASS seats: 2 |
| 121 | +- Degraded seats: 1 (service filter) |
| 122 | +- Offline seats: 0 |
| 123 | +- Final retries of degraded seat: 1 |
| 124 | +- Fallback: primary reviewer completed the full diff and security reconciliation |
| 125 | +- Code-discovery source: repository knowledge graph plus exact immutable Git diffs |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +- `schema_version: 1` |
| 130 | +- `mode: full` |
| 131 | +- `panel_size: 3` |
| 132 | +- `final_live_votes: 2` |
| 133 | +- `final_pass_votes: 2` |
| 134 | +- `degraded_seats: 1` |
0 commit comments