fix(people): harden governed People reads - #55
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Root-cause repair on exact current head |
|
Exact-current-head local review for |
|
@opencode-agent Please review the current unchanged head against protected |
There was a problem hiding this comment.
Pull request overview
OpenCode reviewed the current-head product diff. Coverage is a separate gate.
Changed files
CHANGELOG.md— repository behaviormanifest.json— repository behaviorservices/people-api/README.md— repository behaviorservices/people-api/src/orgmetra_people_api/hire_http.py— Python module behaviorservices/people-api/src/orgmetra_people_api/http.py— Python module behaviorservices/people-api/src/orgmetra_people_api/people.py— Python module behaviorservices/people-api/tests/test_hire_http_error_schema.py— regression suiteservices/people-api/tests/test_hire_http_route.py— regression suiteservices/people-api/tests/test_http_query_limits.py— regression suiteservices/people-api/tests/test_http_route.py— regression suiteservices/people-api/tests/test_people_read_runtime_integrity.py— regression suiteservices/people-api/tests/test_read_auth_backend_failure.py— regression suite
Changed behavior
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Repository file: CHANGELOG.md"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Repository file: CHANGELOG.md"]
R1 --> V1["required checks"]
Evidence --> S2["Repository file: manifest.json"]
S2 --> I2["repository behavior"]
I2 --> R2["Review risk: Repository file: manifest.json"]
R2 --> V2["required checks"]
Evidence --> S3["Repository file: README.md"]
S3 --> I3["repository behavior"]
I3 --> R3["Review risk: Repository file: README.md"]
R3 --> V3["required checks"]
Evidence --> S4["Python: hire_http.py (3 files)"]
S4 --> I4["Python module behavior"]
I4 --> R4["Review risk: Python: hire_http.py (3 files)"]
R4 --> V4["pytest plus coverage"]
Evidence --> S5["Test: test_hire_http_error_schema.py (6 files)"]
S5 --> I5["regression suite"]
I5 --> R5["Review risk: Test: test_hire_http_error_schema.py (6 files)"]
R5 --> V5["targeted test run"]
Findings
No source-backed product finding is synthesized from the coverage gate. A coverage miss belongs in the status comment.
- Head SHA:
27f09897507182f8ddcb090dd7273dcbaf182e36 - Workflow run: 33448176544
- Workflow attempt: 1
- Coverage gate:
failure
Review outcome
Coverage is a gate, not the review. This body reviews the changed product files.
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Repository file: CHANGELOG.md"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Repository file: CHANGELOG.md"]
R1 --> V1["required checks"]
Evidence --> S2["Repository file: manifest.json"]
S2 --> I2["repository behavior"]
I2 --> R2["Review risk: Repository file: manifest.json"]
R2 --> V2["required checks"]
Evidence --> S3["Repository file: README.md"]
S3 --> I3["repository behavior"]
I3 --> R3["Review risk: Repository file: README.md"]
R3 --> V3["required checks"]
Evidence --> S4["Python: hire_http.py (3 files)"]
S4 --> I4["Python module behavior"]
I4 --> R4["Review risk: Python: hire_http.py (3 files)"]
R4 --> V4["pytest plus coverage"]
Evidence --> S5["Test: test_hire_http_error_schema.py (6 files)"]
S5 --> I5["regression suite"]
I5 --> R5["Review risk: Test: test_hire_http_error_schema.py (6 files)"]
R5 --> V5["targeted test run"]
OpenCode Review Overview
Coverage evidence did not pass, so approval is blocked. The formal pull-request review is the source-backed diff review, not this status comment. |
Adopt protected develop@eb9757f8649aaad026a9865508d9aad50c1a7a4f by ordinary merge while preserving the governed People-read source, tests, and service documentation. Keep the protected consolidated workflow and manifest truth; feature-owned manifest resealing follows after the pending People read-boundary repairs.
Add adversarial REDs for exact UUID instances whose internal int payload is executable or out of RFC 9562 range, and for post-validation replacement of the PostgreSQL People read connection capability. Both must fail closed before attacker-controlled comparison or persistence use.
Reject exact UUID objects whose retained integer payload is non-integer or outside the operational RFC 9562 range before comparison or formatting. Store the accepted PostgreSQL connection factory in immutable tuple payload and consume that exact payload directly, preventing post-validation capability substitution.
Restore the valid People read-hardening changelog delta lost while adopting protected workflow consolidation, and reseal the protected foundation manifest against that exact root document. This preserves the canonical feature history without copying stale workflow inventory.
Restore the protected workflow-consolidation changelog line alongside the valid People read-hardening entry. The manifest is intentionally left at the prior seal so Foundation can produce the exact current repair data for the combined document before a follow-up reseal.
Apply Foundation's exact current-head manifest repair for the combined People-read and protected workflow-history changelog. The seal uses the validator-produced SHA-256, byte count, and line count without changing the document or validation contract.
Scope and canonical ownership
This PR is the single writer for governed People reads. It preserves authenticated-actor-before-read, tenant/purpose isolation, field minimization, PostgreSQL RLS/read-only transaction, and candidate-worker read contracts while repairing verified People read-boundary defects. People domain truth remains in Orgmetra; no mutable sibling implementation or cross-service SQL is imported.
Protected-parent adoption
Protected truth remains
develop@eb9757f8649aaad026a9865508d9aad50c1a7a4f. The historical feature head diverged from that parent, so the stale base was repaired rather than closed.0ce9567b70dc63217b9badbe677523a2ea6b9500adopted current protecteddevelopthrough an ordinary two-parent merge without force-push or destructive rebase. Subsequent ordinary-forward commits restored both the valid People-read changelog delta and the protected workflow-consolidation history, then resealedmanifest.jsonfrom Foundation-produced exact file evidence.#263 — UUID retained-payload trust boundary
Test-first
b8ea2732f4f1c7956361f7ba111b63a1200e84f8proved an exactuuid.UUIDcan carry a replaced internal.intpayload whose comparison is executable or outside the RFC 9562 constructor range.a8333a88217c059518edf8fe1cbe61c7e5b5ae75applies the minimal fail-closed repair: exact outer UUID, one retained-payload snapshot, exact built-inint, and0 < identity < (1 << 128) - 1before downstream use.#265 — PostgreSQL executable-capability binding
The same test-first head proved the former frozen/slotted adapter could have its validated
connection_factoryreplaced after construction.a8333a88217c059518edf8fe1cbe61c7e5b5ae75structurally binds the accepted callable in immutable tuple payload and invokes that exact capability while preserving the public constructor, read-only transaction, transaction-local tenant context, parameterized SQL, and duplicate-lineage fail-closed behavior.#276 — People repository capability binding
Fresh review of predecessor
41d00e70f5e62b1039aff7c401eae524d0b3bc11foundread_worker_people_record()still performed a fresh dynamicread_port.read_worker(...)lookup after purpose-bound authorization. A caller-controlled descriptor/__getattribute__could therefore substitute executable repository behavior after the access decision, and a concrete class inheriting only thePeopleReadPort.read_workerProtocol declaration was not rejected as a missing implementation.Test-only
d7e508b814b8116ab06c0f61061d04509099c0f4adds both causal regressions; no hosted RED is claimed for that short-lived head. Productionf84eaf099b076a9143713490842631d5b830ed0dcaptures the ordinary class method inertly withinspect.getattr_static, rejects both non-FunctionTypedependencies and the canonical Protocol declaration itself, and invokes that same captured function directly after authorization without a second dynamic lookup.2ba4b6fd3fa2d9ebfd06741a6d553dec4d6db12fmakes the People service contract code-current.Current-head code-quality review then found the hostile test double raised a non-standard
AssertionErrorfrom__getattribute__. The finding was valid but did not invalidate the production repair. Ordinary-forward147b8fc2f1938cb69b45532a0418ae78dca0be30changes only the trap toAttributeError, preserving the causal RED against a vulnerable post-authorization lookup while honoring Python attribute-resolution semantics. The inline thread was answered with exact evidence and resolved. Issue #276 remains open through hosted acceptance and protected integration.Exact-head evidence
Current exact head is
147b8fc2f1938cb69b45532a0418ae78dca0be30, direct against protecteddevelop@eb9757f8649aaad026a9865508d9aad50c1a7a4f, and GitHub reports the PR mechanically mergeable.Fresh exact-head source/review gates are terminal GREEN: Foundation
34281722422, Security34281722400, SAST34281722376, Required Noema34281720641, Required OpenCode34281720645, Required PR Review Merge Scheduler34281720646, and Dynamic Code Quality34281718875all succeeded.Two required central-runtime gates remain RED without a new Orgmetra source finding. CodeQL
34281722437failed because Python compatibility job102248729053enforced at 21:44:33Z and Actions compatibility job102248729269enforced at 21:44:41Z beforeDispatch current-head CodeQL scanjob102249586821even started at 21:46:56Z; the dispatch then succeeded at 21:47:03Z. This exact consumer canary is handed to canonical combined repair.github#2040; no unchanged-head rerun, synthetic status, sleep/poll workaround, or consumer workflow edit is used.Required Strix
34281720649failed only in job102249156796atProvision contextual-orchestrator Strix sidecarafter current-PR admission, trusted checkout, current-head fetch, workflow self-test and secret gate had succeeded. Actual Strix install/model/quick-scan steps were never reached. This exact sidecar-bootstrap canary is handed to.github#1948; no direct-provider model, paid fallback, rerun, or gate weakening is used.Fresh review enumeration contains no qualifying independent non-author
APPROVED. All returned inline review threads, including the current-head code-quality finding, are resolved. The PR therefore remains Draft until the required central owners produce normal protected GREEN and current-head review policy is satisfied.Baseline handoff
The durable checked-versus-used capability invariant was handed to the canonical baseline writer #100 without modifying
docs/product-technical-gap-baseline.mdfrom this branch. The baseline handoff records People #276 as a second bounded-context application of the existing repository-capability invariant while explicitly forbidding mutable Workforce Validation source copying.