chore: reconcile repository truth and security contracts after offline pipeline merges #9
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.71) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.71 · 493 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.371
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.071
Real PR Conversation Timeline
1 comments
"Review active on #9"
general
weight: 0.35
Xander-Xai
Why
Several rapid merge rounds (PR #3–#7) left current documentation, repository governance, and a small number of runtime contracts inconsistent with the final
mainbranch. This PR re-derives repository truth from the code/tests/config atmain(7edd740) and aligns the current docs and drift guards to it. Historical CHANGELOG release entries and merged PR bodies are not rewritten.Repository governance
MERGED); no GitHub Release/tag exists.CLOSED(unchanged); #2 re-scoped from "implement + validate" to implementation-complete andCLOSEDas completed, with external validation split into successor #8.main; this PR adds one reconciliation branch.Security fixes
GET /api/media/{doc_id}previously didpayload.get("role_mask", 0)/payload.get("dept_mask", 0), so missing permission metadata was treated as public. It now reusescommon.auth.is_document_authorized, so missing/malformed/negative/out-of-uint32 masks are denied.common.auth.parse_identityonly attempted Bearer verification when the legacyJWT_SECRETwas enabled, so an RS256-only deployment never verified its own access tokens. Bearer verification is now always attempted; the HS256 fallback remains optional inside_decode_jwt.Documentation reconciliation
docs/repository-truth-audit.md: refreshed verification date, recorded merged PR #3–#7, Elasticsearchsearch_afterpagination sorting on unique keywordchunk_id(not ES8_id), accurate CI state, and corrected the 2.3.0 offline-history semantics.CHANGELOG.md:[Unreleased]records the PR #7 sort fix distinctly from the earlier pagination path; removed range-bound wording. Historical releases untouched.PRD.md: RBAC documented as a uint32 mask contract with fail-closed handling; removed non-implemented Qdrantnlist/nprobeIVF tuning;is_allowed()pseudocode matchescommon/auth.py.README.md/docs/*: documented the RS256-primary / legacy-HS256-fallback boundary, the media RBAC fail-closed check, and Elasticsearch pagination.Drift prevention
scripts/check_repo_consistency.pyno longer hardcodes one verification date: it requires an ISOYYYY-MM-DDdate and resolves the candidate from symbolicHEAD. It does not depend on the current date or GitHub API.GET /metricsroute, and any PRD RBAC claim that is not uint32.Validation
Run locally on the reconciliation HEAD:
Each of the five commits in this branch individually passes the repository consistency guard.
Regression evidence:
test_rs256_token_accepted_without_legacy_secretfails without the auth fix and passes with it.External validation still pending
These are implemented in code but not validated against real external assets/runtimes, and this PR does not claim otherwise:
EXTERNAL_MODEL_ASSET_REQUIREDEXTERNAL_MODEL_ASSET_REQUIREDTracked in #8. Deterministic fake embedders and real Qdrant + Elasticsearch integration are not real-model validation.