@arbiterforge/ca-pi 0.16.5 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/plugins/ca-pi/CHANGELOG.md +46 -0
  4. package/plugins/ca-pi/agents/map-deps.md +26 -26
  5. package/plugins/ca-pi/agents/map-structure.md +27 -28
  6. package/plugins/ca-pi/agents/tribunal-lens-reviewer.md +70 -39
  7. package/plugins/ca-pi/generated/roles.json +2 -5
  8. package/plugins/ca-pi/helpers/artifacts/release.json +18 -18
  9. package/plugins/ca-pi/hooks/_artifactauthoritylib.py +16 -10
  10. package/plugins/ca-pi/hooks/_artifactlib.py +29 -2
  11. package/plugins/ca-pi/hooks/_contextmergelib.py +160 -0
  12. package/plugins/ca-pi/hooks/_githooks.py +2 -0
  13. package/plugins/ca-pi/hooks/_host.py +1 -1
  14. package/plugins/ca-pi/hooks/_tribunalinventorylib.py +653 -0
  15. package/plugins/ca-pi/hooks/_tribunalrunlib.py +652 -0
  16. package/plugins/ca-pi/hooks/hostapi.py +1 -1
  17. package/plugins/ca-pi/hooks/resolve-context-conflict.py +8 -0
  18. package/plugins/ca-pi/hooks/tribunal.py +113 -0
  19. package/plugins/ca-pi/package.json +1 -1
  20. package/plugins/ca-pi/routines/finishing-a-development-branch/SKILL.md +29 -0
  21. package/plugins/ca-pi/routines/tribunal/SKILL.md +192 -99
  22. package/plugins/ca-pi/routines/tribunal/references/ai-markers.md +6 -27
  23. package/plugins/ca-pi/routines/tribunal/references/cost-and-models.md +73 -52
  24. package/plugins/ca-pi/routines/tribunal/references/finding-record.md +69 -13
  25. package/plugins/ca-pi/routines/tribunal/references/issue-filing.md +63 -45
  26. package/plugins/ca-pi/routines/tribunal/references/lenses/appsec.md +55 -12
  27. package/plugins/ca-pi/routines/tribunal/references/lenses/architecture.md +51 -13
  28. package/plugins/ca-pi/routines/tribunal/references/lenses/change-closure.md +65 -0
  29. package/plugins/ca-pi/routines/tribunal/references/lenses/coverage.md +51 -10
  30. package/plugins/ca-pi/routines/tribunal/references/lenses/infra.md +53 -13
  31. package/plugins/ca-pi/routines/tribunal/references/lenses/migration.md +52 -12
  32. package/plugins/ca-pi/routines/tribunal/references/lenses/observability.md +52 -11
  33. package/plugins/ca-pi/routines/tribunal/references/lenses/performance.md +52 -12
  34. package/plugins/ca-pi/routines/tribunal/references/lenses/reliability.md +53 -13
  35. package/plugins/ca-pi/routines/tribunal/references/lenses/secrets-supply.md +55 -12
  36. package/plugins/ca-pi/routines/tribunal/references/lenses/semantic-contract.md +62 -0
  37. package/plugins/ca-pi/routines/tribunal/references/lenses/test-fidelity.md +48 -13
  38. package/plugins/ca-pi/routines/tribunal/references/lenses/typesafety.md +52 -11
  39. package/plugins/ca-pi/routines/tribunal/references/report.md +34 -12
  40. package/plugins/ca-pi/routines/tribunal/references/review-risk.md +78 -0
  41. package/plugins/ca-pi/routines/tribunal/references/schemas.md +171 -38
  42. package/plugins/ca-pi/routines/tribunal/references/telemetry.md +52 -17
  43. package/plugins/ca-pi/routines/tribunal/references/triage.md +95 -47
  44. package/plugins/ca-pi/routines/tribunal/references/verification-quality.md +61 -0
  45. package/plugins/ca-pi/skills/ca-pr/SKILL.md +29 -0
  46. package/plugins/ca-pi/skills/ca-tribunal/SKILL.md +192 -99
@@ -1,20 +1,61 @@
1
1
  # coverage — lens mandate
2
2
 
3
- Executed by `tribunal-lens-reviewer` under the `coverage` assignment. Write contract + evidence discipline: `finding-record.md`.
3
+ Executed by `tribunal-lens-reviewer` under the `coverage` assignment.
4
+
5
+ ## Purpose / failure family
6
+ Find missing behavioral verification or weak oracles that let a plausible wrong
7
+ implementation pass. Coverage owns obligations and oracle strength.
8
+
9
+ ## Applicability
10
+ Assigned behavior has a concrete correctness, security, compatibility or recovery
11
+ obligation whose verification can be examined.
12
+
13
+ ## Skip conditions
14
+ No applicable executable behavior or verifiable obligation. Lack of a particular
15
+ test framework or numerical coverage report is not itself a finding.
4
16
 
5
17
  ## Scope emphasis
6
- Source-and-test pairs on risk paths in the assigned slice (auth, money, data-mutation, error handling).
18
+ Risk-path source/test pairs: authorization, persistent mutation, error ownership,
19
+ boundary behavior, concurrency, cancellation and compatibility where relevant.
7
20
 
8
21
  ## Required reading
9
- - `<project-root>/.codearbiter/tech-stack.md` — test and coverage invocations; `inventory.md` in the run dir — the risk overlay.
22
+ - Finding record (`<plugin-root>/routines/tribunal/references/finding-record.md`) and review risk (`<plugin-root>/routines/tribunal/references/review-risk.md`).
23
+ - Verification quality (`<plugin-root>/routines/tribunal/references/verification-quality.md`) — shared oracle discipline and complementary ownership.
24
+ - `<project-root>/.codearbiter/tech-stack.md` — test suites, alternate harnesses
25
+ and declared coverage model; current requirements and inventory risk paths.
26
+
27
+ ## Deterministic probes
28
+ Inspect source/test relationships, assertion targets, existing coverage reports
29
+ and test-selection rules. Locate integration/contract checks before claiming a
30
+ unit has no protection; execution counts alone do not reveal oracle strength.
31
+
32
+ ## Review questions
33
+ - Which independent expectation would a realistic wrong implementation violate?
34
+ - Does an assertion detect it, or only execution, a call count or copied output?
35
+ - Are relevant forbidden behavior, error, boundary and compatibility cases checked?
36
+ - Could a focused mutation, property, differential or metamorphic check cheaply
37
+ discriminate the suspected fault under authorized verification?
38
+
39
+ ## False-positive guards / non-findings
40
+ A limited smoke test is valid for a smoke obligation. Interaction assertions can
41
+ test a real protocol. Low percentages, small test counts and generated tests do
42
+ not establish a gap; good behavioral coverage can live in another harness.
43
+
44
+ ## Evidence requirements
45
+ Name the obligation, plausible fault and missing or ineffective assertion. State
46
+ the searched suites and alternate harnesses and trace ownership of the behavior.
47
+ Distinguish a reasoned surviving-fault example from an actually executed mutation;
48
+ never claim the latter without captured results.
10
49
 
11
- ## Checklist
12
- - Coverage gaps on risk paths (auth, money, data-mutation, error handling).
13
- - Missing edge-case/property coverage; the empty/null/single-item and zero-value cases.
14
- - Tests asserting implementation detail rather than observable behavior.
50
+ ## Exposure metric
51
+ Count of distinct risk-path obligations whose case selection and oracle were
52
+ examined, with unexamined obligations reported separately.
15
53
 
16
- ## Exposure
17
- Count of risk paths examined (`inventory.md` risk overlay).
54
+ ## Escalation / cross-lens handoff
55
+ Test-fidelity owns mismatched doubles/fixtures; send it a lead when that is the
56
+ root mechanism. Send proved product defects to their domain lens and corroborate
57
+ the root cause rather than count both the defect and its missing test as duplicates.
18
58
 
19
59
  ## Out of scope
20
- Tests validating fiction (test-fidelity); the underlying bug itself (reliability).
60
+ Mock presence, fixture-contract fidelity, implementing tests, and claiming that a
61
+ coverage percentage proves correctness.
@@ -1,24 +1,64 @@
1
1
  # infra — lens mandate
2
2
 
3
- Executed by `tribunal-lens-reviewer` under the `infra` assignment. Write contract + evidence discipline: `finding-record.md`.
3
+ Executed by `tribunal-lens-reviewer` under the `infra` assignment.
4
+
5
+ ## Purpose / failure family
6
+ Find unsafe build, deployment and publication boundaries, or configuration
7
+ failures that compromise the promised runtime/release behavior.
8
+
9
+ ## Applicability
10
+ The assigned scope includes CI, containers, infrastructure configuration,
11
+ deployment or release automation with meaningful trust or lifecycle boundaries.
12
+
13
+ ## Skip conditions
14
+ No affected pipeline/deployment surface. Do not infer a hosted-service posture
15
+ for a local development fixture or a declared disposable environment.
4
16
 
5
17
  ## Scope emphasis
6
- CI workflows, Dockerfiles/compose, IaC and deploy manifests, release automation in the assigned slice.
18
+ Workflow event to credential/artifact/publish boundary; container and deploy
19
+ configuration to actual exposed service, privilege and resource lifecycle.
7
20
 
8
21
  ## Required reading
9
- - `<project-root>/.codearbiter/security-controls.md` — trust boundaries and approved secret stores; `<project-root>/.codearbiter/tech-stack.md` — deploy targets and CI conventions.
22
+ - Finding record (`<plugin-root>/routines/tribunal/references/finding-record.md`) and review risk (`<plugin-root>/routines/tribunal/references/review-risk.md`).
23
+ - `<project-root>/.codearbiter/security-controls.md` — pipeline trust and secret
24
+ boundaries; `<project-root>/.codearbiter/tech-stack.md` — deploy targets,
25
+ CI/release contracts and applicable protections.
26
+
27
+ ## Deterministic probes
28
+ Inspect workflow triggers/permissions, action/image references, cache/artifact
29
+ producers and consumers, publish conditions, container users/mounts and deploy
30
+ exposure. Use existing configuration/provenance receipts; do not trigger jobs.
31
+
32
+ ## Review questions
33
+ - Can untrusted event data become shell syntax, credential access or executable
34
+ candidate code in a privileged workflow?
35
+ - Can a less-trusted cache or artifact cross into release without identity checks?
36
+ - Do masked failures or mismatched protections permit publication after failed gates?
37
+ - Are image provenance, privileges, secret layers and service exposure consistent
38
+ with the declared threat model?
39
+ - Can deploy ordering, resource exhaustion or environment drift violate availability?
40
+
41
+ ## False-positive guards / non-findings
42
+ A tag, root user or wide permission is a lead, not automatic exploitability.
43
+ Establish the reachable event, actual credential scope and accepted controls.
44
+ Inherited protections require evidence; unavailable remote settings remain
45
+ unverified rather than presumed missing or effective.
10
46
 
11
- ## Checklist
12
- - CI/CD workflows: untrusted input (PR titles, branch names, comments) interpolated into `run:` steps; excessive workflow/token `permissions`; third-party actions pinned to tags, not SHAs; fork-writable cache keys (poisoning); artifacts promoted without provenance; masked failures (swallowed exit codes) ahead of a publish step.
13
- - Container posture: base image unpinned or of unvetted provenance; running as root; secrets baked into layers or build args.
14
- - IaC/deploy manifests: drift between environments; missing resource limits; services exposed wider than intended.
15
- - Release automation: publish/tag steps ungated by branch or tag protections.
47
+ ## Evidence requirements
48
+ Show the event/input-to-privilege or configuration-to-runtime trace and concrete
49
+ consequence. Absence claims state the search universe across reusable workflows,
50
+ environment/repository controls and deployment owners. Bind artifact claims to
51
+ actual identity; a successful source check does not prove published bytes.
16
52
 
17
- ## Categories & severity
18
- `security` for exploitable pipeline issues (injection, token overreach, cache poisoning); `dependency` for provenance/pinning; `reliability` for deploy-config correctness. Exploitable-from-fork is critical/high.
53
+ ## Exposure metric
54
+ Count of pipeline/deploy boundary paths inspected, distinguishing source
55
+ configuration from verified external settings and artifact evidence.
19
56
 
20
- ## Exposure
21
- Count of workflows + Dockerfiles/compose files + IaC/deploy manifests examined.
57
+ ## Escalation / cross-lens handoff
58
+ Route application dependency trust to secrets-supply and incomplete propagation
59
+ to change-closure. Corroborate one root defect when bad artifact trust also
60
+ appears as a release-closure issue.
22
61
 
23
62
  ## Out of scope
24
- Supply-chain risk of app dependencies (secrets-supply) — this lens owns the pipeline and deploy surface itself.
63
+ Changing infrastructure, running jobs, application dependency audits and severity
64
+ based solely on a configuration signature.
@@ -1,22 +1,62 @@
1
1
  # migration — lens mandate
2
2
 
3
- Executed by `tribunal-lens-reviewer` under the `migration` assignment. Write contract + evidence discipline: `finding-record.md`.
3
+ Executed by `tribunal-lens-reviewer` under the `migration` assignment.
4
+
5
+ ## Purpose / failure family
6
+ Find schema/data transitions that violate compatibility, integrity, availability
7
+ or recovery obligations under the repository's declared deployment model.
8
+
9
+ ## Applicability
10
+ Assigned changes migrate persisted data/schema or alter how deployed versions
11
+ read and write it.
12
+
13
+ ## Skip conditions
14
+ No persisted transition or affected rollout contract. When the deploy model is
15
+ unknown, preserve that uncertainty instead of assuming a reversible rollout.
4
16
 
5
17
  ## Scope emphasis
6
- Migration files in the assigned slice, cross-referenced against schema and query code.
18
+ Migration order, schema and query consumers, backfills, deployment windows and
19
+ recovery procedures for the affected data.
7
20
 
8
21
  ## Required reading
9
- - `<project-root>/.codearbiter/security-controls.md` — data-classification categories; `<project-root>/.codearbiter/tech-stack.md` — ORM/schema conventions.
22
+ - Finding record (`<plugin-root>/routines/tribunal/references/finding-record.md`) and review risk (`<plugin-root>/routines/tribunal/references/review-risk.md`).
23
+ - `<project-root>/.codearbiter/tech-stack.md` — declared migration/deploy model,
24
+ schema tools and version overlap; `<project-root>/.codearbiter/security-controls.md`
25
+ for relevant data classification and recovery obligations.
26
+
27
+ ## Deterministic probes
28
+ Inspect migration history/order, schema diffs, deployed-version compatibility
29
+ matrices, query references and available table-size/lock evidence. Read recovery
30
+ and rollout checks as evidence; do not apply or roll back migrations.
31
+
32
+ ## Review questions
33
+ - Does expand/contract ordering preserve mixed-version readers and writers?
34
+ - Can a backfill lose, duplicate or misclassify data, or fail partway irrecoverably?
35
+ - Do NOT NULL, renames, drops and index operations respect actual data and locks?
36
+ - Is destructive or irreversible work guarded by the required recovery evidence?
37
+ - Does editing a previously applied migration create divergent environments?
38
+
39
+ ## False-positive guards / non-findings
40
+ A declared forward-only model may use a corrective migration and verified restore
41
+ procedure; a down migration is not universally required. A disposable schema or
42
+ exclusive downtime window may have different obligations from a rolling deploy.
43
+ Do not invent annotation or immutability requirements absent the actual contract.
44
+
45
+ ## Evidence requirements
46
+ Cite the deployment model, affected data/version window, operation order and
47
+ concrete compatibility, locking or recovery failure. For an absent backfill or
48
+ recovery path, state the search universe across migrations, deployment orchestration
49
+ and recovery owners. Bound scale claims with available size/lock evidence.
10
50
 
11
- ## Checklist
12
- - Reversibility: rollback/down path present; destructive ops (DROP, TRUNCATE) guarded; NOT NULL added without DEFAULT/backfill; single-step rename that breaks queries mid-deploy.
13
- - Data-classification annotation present for tables holding sensitive data (PII, credentials, payment, audit).
14
- - Immutability: edits to an already-committed migration (schema divergence across environments).
15
- - Index concurrency on large tables; locks that block production traffic.
16
- - Schema-to-code drift, backfill correctness, operation ordering, unguarded destructive operations.
51
+ ## Exposure metric
52
+ Count of persisted transitions checked with their application-version and
53
+ recovery windows, not only migration-file count.
17
54
 
18
- ## Exposure
19
- Count of migration files reviewed.
55
+ ## Escalation / cross-lens handoff
56
+ Route rollout wiring to infra/change-closure, application authorization to appsec
57
+ and secret exposure to secrets-supply. Keep missing recovery proof distinct from
58
+ a demonstrated unrecoverable transition.
20
59
 
21
60
  ## Out of scope
22
- Application-level data handling (appsec/secrets).
61
+ Applying migrations, universal rollback policy, and unrelated application-level
62
+ data handling outside the assigned transition.
@@ -1,21 +1,62 @@
1
1
  # observability — lens mandate
2
2
 
3
- Executed by `tribunal-lens-reviewer` under the `observability` assignment. Write contract + evidence discipline: `finding-record.md`.
3
+ Executed by `tribunal-lens-reviewer` under the `observability` assignment.
4
+
5
+ ## Purpose / failure family
6
+ Find failures operators or callers cannot diagnose, correlate or recover from
7
+ despite an applicable operational or audit obligation.
8
+
9
+ ## Applicability
10
+ The product's operating model requires diagnosis, correlation, security/audit
11
+ events or failure visibility at the assigned boundary.
12
+
13
+ ## Skip conditions
14
+ Local libraries or pure helpers with no operational/diagnostic contract need not
15
+ have tracing or metrics. Record a skip when diagnosis is adequately owned by
16
+ the caller and no separate obligation applies.
4
17
 
5
18
  ## Scope emphasis
6
- The assigned path slice, weighted to critical paths and boundaries.
19
+ Critical failure/recovery paths and service/async boundaries where actionable
20
+ reason, correlation or audit completeness is required.
7
21
 
8
22
  ## Required reading
9
- - `<project-root>/.codearbiter/tech-stack.md` — logging/tracing/metrics stack; `inventory.md` in the run dir — the boundary map.
23
+ - Finding record (`<plugin-root>/routines/tribunal/references/finding-record.md`) and review risk (`<plugin-root>/routines/tribunal/references/review-risk.md`).
24
+ - `<project-root>/.codearbiter/tech-stack.md` — logging/tracing/metrics stack
25
+ and operating model; applicable runbook/audit contracts and inventory boundaries.
26
+
27
+ ## Deterministic probes
28
+ Inspect event/error emission, correlation propagation and diagnostic consumers.
29
+ Compare declared event requirements with existing logging/audit tests and
30
+ operational evidence; event counts do not prove diagnostic usefulness.
31
+
32
+ ## Review questions
33
+ - Can an operator distinguish the critical failure reason and select recovery?
34
+ - Is required correlation preserved across the actual async/service boundary?
35
+ - Are security/audit outcomes complete enough for the declared forensic purpose?
36
+ - Are diagnostic details bounded and appropriate to the recipient?
37
+ - Does a suppressed or misleading success signal hide a relevant failure mode?
38
+
39
+ ## False-positive guards / non-findings
40
+ No universal tracing, structured-logging or metrics requirement applies.
41
+ Central instrumentation and returned errors may satisfy a boundary's obligation.
42
+ Do not propose logging every call or emitting duplicate diagnostics without
43
+ showing which real failure would remain undiagnosable.
44
+
45
+ ## Evidence requirements
46
+ Cite the required operational/audit obligation, failure scenario and unavailable
47
+ diagnostic or recovery decision. For missing signals, state the search universe
48
+ and ownership trace through emitters, middleware, collectors and callers; include
49
+ available evidence about retention/visibility without assuming remote settings.
10
50
 
11
- ## Checklist
12
- - Missing or inconsistent structured logging on critical paths.
13
- - Absent tracing / correlation IDs across service or async boundaries.
14
- - No metrics on critical paths; audit-trail gaps for security-relevant events.
15
- - Sensitive-data-in-logs is flagged once, by the secrets lens — do not double-report it here.
51
+ ## Exposure metric
52
+ Count of applicable failure/audit boundary paths whose diagnostic outcome was
53
+ traced, not raw log statements.
16
54
 
17
- ## Exposure
18
- Count of boundary crossings / critical paths inspected (`inventory.md` boundary map).
55
+ ## Escalation / cross-lens handoff
56
+ Send sensitive-data logging to secrets-supply and the underlying lost operation
57
+ to reliability. Keep a diagnostic consequence as corroboration when it shares
58
+ the same root failure rather than filing duplicate findings.
19
59
 
20
60
  ## Out of scope
21
- Whether the logged operation is itself correct (reliability).
61
+ Tracing for its own sake, correctness of the logged operation, and independent
62
+ secret disclosure findings.
@@ -1,22 +1,62 @@
1
1
  # performance — lens mandate
2
2
 
3
- Executed by `tribunal-lens-reviewer` under the `performance` assignment. Write contract + evidence discipline: `finding-record.md`; flag a signature only where the path is plausibly hot — no speculative micro-optimization.
3
+ Executed by `tribunal-lens-reviewer` under the `performance` assignment.
4
+
5
+ ## Purpose / failure family
6
+ Find demonstrable latency, throughput or resource failures under a supported
7
+ workload, including repeated expensive work and unbounded growth.
8
+
9
+ ## Applicability
10
+ There is a documented SLO/resource constraint, observed benchmark/profile, clear
11
+ asymptotic bound, plausible hot-path repeated I/O, unbounded growth or demonstrable
12
+ scale multiplier.
13
+
14
+ ## Skip conditions
15
+ No supported workload or performance premise can be established. Lack of a
16
+ benchmark alone is not a skip when the code establishes an unbounded cost path.
4
17
 
5
18
  ## Scope emphasis
6
- The assigned path slice, weighted to hot paths and data access.
19
+ Actual hot paths, data access, subprocess/network fan-out, queues/caches and
20
+ resource lifetimes, with cold and bounded operations identified separately.
7
21
 
8
22
  ## Required reading
9
- - `<project-root>/.codearbiter/tech-stack.md` — data layer, ORM, and cache conventions.
23
+ - Finding record (`<plugin-root>/routines/tribunal/references/finding-record.md`) and review risk (`<plugin-root>/routines/tribunal/references/review-risk.md`).
24
+ - `<project-root>/.codearbiter/tech-stack.md` — data layer, cache and runtime
25
+ model; relevant SLOs, supported scale, profiles and benchmark conditions.
26
+
27
+ ## Deterministic probes
28
+ Inspect query/I/O/subprocess counts along a bounded path, loop nesting, fan-out
29
+ and retention/eviction bounds. Read existing profiles and query/index evidence;
30
+ do not infer production cost from a loop signature or unrelated benchmark.
31
+
32
+ ## Review questions
33
+ - Does repeated I/O or over-fetching multiply cost on a plausibly exercised path?
34
+ - Can growth, fan-out or retention escape the stated resource bound?
35
+ - Does blocking work violate an established latency/concurrency constraint?
36
+ - Do cache misses, invalidation or keys create the demonstrated cost or stale result?
37
+ - Does the recommendation address the measured/bounded mechanism at supported scale?
38
+
39
+ ## False-positive guards / non-findings
40
+ Cold bounded loops, small fixed collections and deliberately uncached work may
41
+ be appropriate. "Could cache or memoize" is not a finding. A different index or
42
+ algorithm needs a workload and cost argument; benchmark noise is not a regression.
43
+
44
+ ## Evidence requirements
45
+ Provide the observed or documented workload/scale premise, or an explicit
46
+ asymptotic/resource bound and reachable input multiplier. Show the costly path
47
+ and expected consequence, separating measurement from inference. For absent
48
+ batching/cache/limits, state the search universe through callers and data/resource
49
+ owners; centralized bounds can refute the claim.
10
50
 
11
- ## Checklist
12
- - N+1 queries and per-iteration IO in loops.
13
- - Redundant hot-path work; recomputation that could be hoisted or memoized.
14
- - Query/index shape: filters/sorts on unindexed columns; over-fetching.
15
- - Missing or incorrect caching; cache keys that never invalidate or collide.
16
- - Blocking IO on latency-critical paths.
51
+ ## Exposure metric
52
+ Count of workload/path pairs evaluated with their premise and bound, identifying
53
+ which conclusions are measured and which are statically inferred.
17
54
 
18
- ## Exposure
19
- Count of hot-path/data-access sites inspected.
55
+ ## Escalation / cross-lens handoff
56
+ Send wrong cached results or races to reliability, externally exploitable
57
+ resource exhaustion to appsec, and missing benchmark discrimination to coverage.
58
+ Combine evidence when the cost and correctness symptoms share one cause.
20
59
 
21
60
  ## Out of scope
22
- Correctness of the logic itself (reliability).
61
+ Speculative micro-optimization, universal caching and unsupported production
62
+ latency claims.
@@ -1,23 +1,63 @@
1
1
  # reliability — lens mandate
2
2
 
3
- Executed by `tribunal-lens-reviewer` under the `reliability` assignment. Write contract + evidence discipline: `finding-record.md`.
3
+ Executed by `tribunal-lens-reviewer` under the `reliability` assignment.
4
+
5
+ ## Purpose / failure family
6
+ Find lost failures, corrupt or orphan state, unsafe concurrency and incomplete
7
+ resource lifecycles by tracing ownership and recovery semantics.
8
+
9
+ ## Applicability
10
+ The assigned code performs fallible work, owns mutable state/resources, or
11
+ coordinates asynchronous, concurrent or restartable operations.
12
+
13
+ ## Skip conditions
14
+ No relevant state transition, fallible boundary or lifecycle. Syntax alone does
15
+ not make a synchronous or pure helper a reliability risk.
4
16
 
5
17
  ## Scope emphasis
6
- The assigned path slice: async correctness, error propagation, races, resource lifecycle, boundary conditions, orphan state.
18
+ Follow operations from initiation through success, failure, cancellation,
19
+ deadline and restart, including direct callers and the resource/state owner.
7
20
 
8
21
  ## Required reading
9
- - `<project-root>/.codearbiter/tech-stack.md` — async model and concurrency primitives.
22
+ - Finding record (`<plugin-root>/routines/tribunal/references/finding-record.md`) and review risk (`<plugin-root>/routines/tribunal/references/review-risk.md`).
23
+ - `<project-root>/.codearbiter/tech-stack.md` — async/concurrency model and
24
+ persistence primitives; relevant error, lifecycle and recovery contracts.
25
+
26
+ ## Deterministic probes
27
+ Enumerate state writers, acquisitions/releases, cancellation/deadline paths and
28
+ retry boundaries. Inspect caller and handler chains and existing failure tests;
29
+ counts of awaits or catches do not establish error ownership.
30
+
31
+ ## Review questions
32
+ - Which boundary owns each failure, and does propagation or translation preserve
33
+ its meaning for the caller? Can a swallowed failure masquerade as success?
34
+ - Are retries bounded and idempotent, with coherent timeout/cancellation outcomes?
35
+ - Can concurrent read-modify-write, reordering or duplicate delivery lose state?
36
+ - Are atomicity, partial failure and fail-open/fail-closed choices consistent with
37
+ the actual contract? Can recovery or restart strand half-written state?
38
+ - Does the lifecycle owner release resources on every relevant terminal path?
39
+
40
+ ## False-positive guards / non-findings
41
+ Intentional propagation to an owning boundary is valid; no local catch is required
42
+ at every await. A documented best-effort operation may intentionally fail silently.
43
+ Do not demand local cleanup when a parent owns the lifecycle, or locking when an
44
+ established transaction/serialization model already provides the invariant.
45
+
46
+ ## Evidence requirements
47
+ Show a concrete failure or interleaving, the violated invariant and its observable
48
+ effect. Absence claims name the search universe and ownership trace through
49
+ callers, central handlers, transaction owners and cleanup/recovery paths.
50
+ Distinguish a plausible schedule from a reproduced race.
10
51
 
11
- ## Checklist
12
- - Async inventory: every `await`, `Promise`, and `.then()` chain has a `.catch`/`try-catch`.
13
- - Error-propagation trace: for every `catch`, what happens next. Acceptable — rethrow, typed fallback, central handler, or a state update notifying the caller. Unacceptable — log-and-return-`undefined`, or swallow entirely. Flag every catch that does not propagate a meaningful signal.
14
- - Race surface: two+ async operations writing shared state (component state, globals, filesystem, DB rows) without locking/serialization; handlers that fire before a prior invocation completes; polling loops without cancellation; message handlers mutating state without queueing.
15
- - Resource lifecycle: every subscription, listener, connection, or timer set up in an init hook has a teardown in cleanup/unmount.
16
- - Boundary conditions: empty, null, single-item collections; zero-value numerics; null API responses.
17
- - Orphan state: state written conditionally but read unconditionally; mutation after unmount (stale closure).
52
+ ## Exposure metric
53
+ Count of operation/state lifecycles traced across their owning boundary,
54
+ including which terminal paths were inspected.
18
55
 
19
- ## Exposure
20
- Count of async sites (await/Promise/then) inspected.
56
+ ## Escalation / cross-lens handoff
57
+ Send exploitability to appsec, diagnosability to observability and inadequate
58
+ fault detection to coverage. Preserve a shared root cause when several lenses
59
+ observe the same lost error or state transition.
21
60
 
22
61
  ## Out of scope
23
- Performance (performance); injection/authz (appsec).
62
+ Local-catch style, speculative speed improvements and unrelated authorization
63
+ claims without a runtime ownership defect.
@@ -1,22 +1,65 @@
1
1
  # secrets-supply — lens mandate
2
2
 
3
- Executed by `tribunal-lens-reviewer` under the `secrets-supply` assignment. Write contract + evidence discipline: `finding-record.md`.
3
+ Executed by `tribunal-lens-reviewer` under the `secrets-supply` assignment.
4
+
5
+ ## Purpose / failure family
6
+ Find unsafe secret/crypto flows and dependency identity, provenance or use that
7
+ creates a concrete trust, exposure or distribution failure.
8
+
9
+ ## Applicability
10
+ Assigned code/configuration handles sensitive values or cryptographic operations,
11
+ or depends on external packages/artifacts.
12
+
13
+ ## Skip conditions
14
+ No relevant secret, crypto or dependency boundary. Unavailable registry or
15
+ advisory evidence is a stated limitation, not a clean result or a missing package.
4
16
 
5
17
  ## Scope emphasis
6
- Source, config, `.env*`, and dependency manifests/lockfiles in the assigned slice.
18
+ Manifests/locks and their intended registries, runtime/build dependency uses,
19
+ secret sources through logs/transmission/storage, and shipped artifact contents.
7
20
 
8
21
  ## Required reading
9
- - `<project-root>/.codearbiter/security-controls.md` — approved secret store and crypto; `<project-root>/.codearbiter/tech-stack.md` — dependency manifests.
22
+ - Finding record (`<plugin-root>/routines/tribunal/references/finding-record.md`) and review risk (`<plugin-root>/routines/tribunal/references/review-risk.md`).
23
+ - `<project-root>/.codearbiter/security-controls.md` — approved secret stores,
24
+ crypto, registries and trust exceptions; `<project-root>/.codearbiter/tech-stack.md`
25
+ for dependency graphs, build/runtime roles and distribution model.
26
+
27
+ ## Deterministic probes
28
+ Inspect lock/manifest consistency, package identity/resolution and redacted secret
29
+ pattern results. Registry-existence, advisory and provenance lookups use available
30
+ evidence or independently authorized probes, with registry/version/time recorded.
31
+ Do not install a package or execute its scripts to inspect it.
32
+
33
+ ## Review questions
34
+ - Does the named package/version exist in the intended registry, and does a
35
+ confusable identity or provenance substitution change the trust assumption?
36
+ - Is dependency use necessary to the behavior, or does a concrete unnecessary
37
+ privilege/attack surface result? What reaches the built or shipped artifact?
38
+ - Does actual vulnerable package use make an advisory applicable?
39
+ - Can a real secret escape into logs, URLs, storage, artifacts or an unintended
40
+ recipient? Are TLS, randomness and cryptographic choices fit for their contract?
41
+
42
+ ## False-positive guards / non-findings
43
+ Clearly inert fixture values and credential-free examples are not leaked secrets.
44
+ An HTTP body over required TLS is not inherently a disclosure. A public-registry
45
+ miss does not prove absence from an intended private registry or workspace alias.
46
+ Package age, dependency count or supposed model training history is not a defect.
47
+
48
+ ## Evidence requirements
49
+ Show the exact package/registry/version or redacted source-to-sink secret flow,
50
+ applicable policy and consequence. Never reproduce raw credentials in findings.
51
+ For absence, state the search universe across locks, registry resolution,
52
+ wrappers, redactors and artifact producers and identify the owning boundary.
10
53
 
11
- ## Checklist
12
- - Literal secrets in source or `.env.example` — JWT/signing keys, API keys, DB connection strings, OAuth secrets, passwords (CWE-798). `.env.example` populated with real values is a common AI regression.
13
- - Weak/misused crypto (CWE-327): MD5/SHA-1 for password hashing; `Math.random()` for tokens instead of a CSPRNG.
14
- - Cleartext transmission: HTTP where HTTPS is required; credentials in query strings or bodies.
15
- - Secrets/PII in logs; debug flags active without an environment gate.
16
- - Supply chain: hallucinated/slopsquatted package names; dependency overuse (large trees from small features); pins current at training time but now deprecated or vulnerable.
54
+ ## Exposure metric
55
+ Report dependency identities and sensitive-data flow paths examined separately,
56
+ including unavailable external checks.
17
57
 
18
- ## Exposure
19
- Count of dependencies examined + config/secret-bearing files scanned.
58
+ ## Escalation / cross-lens handoff
59
+ Infra owns pipeline credential/artifact trust and appsec owns application
60
+ injection/authorization. Send incomplete package propagation to change-closure;
61
+ consolidate shared exposure causes instead of duplicating findings.
20
62
 
21
63
  ## Out of scope
22
- Injection/authz (appsec).
64
+ Installing or updating dependencies, secret extraction, authorship inference
65
+ and pipeline defects owned by infra.
@@ -0,0 +1,62 @@
1
+ # semantic-contract — lens mandate
2
+
3
+ Executed by `tribunal-lens-reviewer` under the `semantic-contract` assignment.
4
+
5
+ ## Purpose / failure family
6
+ Catch plausible implementations that diverge from requested semantics, including
7
+ over-broad changes that pass tests while altering protected behavior.
8
+
9
+ ## Applicability
10
+ A current issue/spec, accepted ADR, public contract, or supported pre-existing
11
+ behavior establishes an expectation for the assigned code.
12
+
13
+ ## Skip conditions
14
+ No affected behavior or usable contract basis. Record missing or conflicting
15
+ expectations as a bounded question; absence of a spec is not a product defect.
16
+
17
+ ## Scope emphasis
18
+ Trace requirements through entry points, decisions, outputs and consumers.
19
+ Compare the changed behavior with both positive and negative obligations.
20
+
21
+ ## Required reading
22
+ - Finding record (`<plugin-root>/routines/tribunal/references/finding-record.md`) and review risk (`<plugin-root>/routines/tribunal/references/review-risk.md`).
23
+ - `<project-root>/.codearbiter/CONTEXT.md` — product scope and vocabulary.
24
+ - Applicable issue/spec, accepted ADR obligations, API/protocol contracts,
25
+ compatibility promises and pre-existing behavior evidence in the packet.
26
+
27
+ ## Deterministic probes
28
+ Inspect changed symbols and direct consumers, contract/schema differences, and
29
+ existing regression expectations. Map each claimed behavior to its cited source;
30
+ do not derive the expected answer by copying the implementation.
31
+
32
+ ## Review questions
33
+ - Does the implementation satisfy the actual requirement, including forbidden
34
+ behavior, edge values, ordering, units and compatibility?
35
+ - Does a broad filter, fallback or default change unrelated pre-existing behavior?
36
+ - Do tests agree with the intended semantics, or share the same wrong interpretation?
37
+ - Are accepted decision obligations implemented at the boundary they govern?
38
+
39
+ ## False-positive guards / non-findings
40
+ Never invent an unwritten requirement or treat a stylistic preference as a
41
+ contract. Conflicting or ambiguous requirements need clarification, not a guessed
42
+ defect. An intentional, authorized behavior change is not a regression merely
43
+ because historical code behaved differently.
44
+
45
+ ## Evidence requirements
46
+ Cite the current expectation and its applicability, a concrete distinguishing
47
+ input/state, the implementation path, and the wrong observable result. For
48
+ missing behavior, name the search universe and trace callers/consumers to its
49
+ owner; checking one branch alone cannot establish absence.
50
+
51
+ ## Exposure metric
52
+ Count of distinct behavioral obligations traced to implementation and consumers;
53
+ report unresolved expectations separately.
54
+
55
+ ## Escalation / cross-lens handoff
56
+ Send inadequate-oracle leads to coverage, stale-double leads to test-fidelity,
57
+ and incomplete propagation to change-closure. Corroborate a shared root cause
58
+ instead of filing a second defect.
59
+
60
+ ## Out of scope
61
+ Inventing product decisions, general test completeness, and distribution closure
62
+ without a semantic mismatch in the assigned finding scope.