target-revenue/tests
tegwick 885da0a1cb Implement Control Plane backend: rights enforcement + audit log (WP-0009-T03)
migrations/0006_control_plane.sql: control_plane_audit_log (append-only,
no UPDATE/DELETE for trf_app) and control_plane_proposed_entries (the
Contributor tier's "propose, don't append" workflow from concept §2) -
review decisions go through a review_proposed_entry() SECURITY DEFINER
function, same governance-action pattern as
set_extension_status/revoke_credential, not a direct UPDATE.

src/target_revenue/control_plane.py is the enforcement layer concept
§2 called for: register_phase/append_development_credit require
Operator+; propose_ledger_entry requires Contributor+ and stores a
pending proposal without touching the real Ledger; approve_proposed_entry
(Operator+) appends it under the *reviewer's own* credential/attribution
(not the original proposer's - the reviewer is who's authorizing it into
the real Ledger, while the proposer stays on record in the proposal row
and audit log); reject_proposed_entry (Operator+) discards it. issue_/
revoke_user_credential (Admin+) wrap registry.py's T02 functions with
the same rights check and audit logging. Every action funnels through
record_audit_event, independent of the Trust Service's own signed
records.

tests/test_control_plane.py (12 tests): rights enforcement at each
tier boundary, the full propose -> approve -> appended-under-reviewer
flow, propose -> reject -> nothing appended, double-review rejection,
audit log content/attribution, DB-level UPDATE rejection on both new
tables. Full suite: 84 offline (unchanged), 53 with Docker (up from
41); no stray containers left running.
2026-07-30 15:08:59 +02:00
..
fixtures Implement TREV-WP-0002 Stage 0 foundation: schemas, pure fold, golden Phase 2026-07-28 18:47:29 +02:00
conftest.py Implement TREV-WP-0002 Stage 0 foundation: schemas, pure fold, golden Phase 2026-07-28 18:47:29 +02:00
test_attestation.py Implement hosted Conversion Attestation publication (WP-0006-T06) 2026-07-29 21:50:02 +02:00
test_breach_record.py Implement hosted Breach/Compliance Record publication (WP-0006-T09) 2026-07-29 22:23:41 +02:00
test_control_plane.py Implement Control Plane backend: rights enforcement + audit log (WP-0009-T03) 2026-07-30 15:08:59 +02:00
test_conversion.py Implement TREV-WP-0002 Stage 0 foundation: schemas, pure fold, golden Phase 2026-07-28 18:47:29 +02:00
test_effort_calculator.py Apply Development Effort Calculator to real pilot candidates (WP-0010-T03) 2026-07-30 13:29:06 +02:00
test_extension_conformance.py Advance WP-0007: degeneration research, profile catalog, canonicalization checklist 2026-07-29 22:31:19 +02:00
test_hosted_conformance.py Extend WP-0006 auth for per-human sub-credentials (WP-0009-T02) 2026-07-30 14:26:33 +02:00
test_ledger_fold.py Merge spec/ into specs/: one specs directory for the whole repo 2026-07-29 10:22:14 +02:00
test_ledger_hosting.py Extend WP-0006 auth for per-human sub-credentials (WP-0009-T02) 2026-07-30 14:26:33 +02:00
test_licensor_credentials.py Extend WP-0006 auth for per-human sub-credentials (WP-0009-T02) 2026-07-30 14:26:33 +02:00
test_manifest_validation.py Implement TREV-WP-0002 Stage 0 foundation: schemas, pure fold, golden Phase 2026-07-28 18:47:29 +02:00
test_metrics.py Implement public metrics service (WP-0006-T05) 2026-07-29 21:42:52 +02:00
test_onboarding_hosted.py Extend WP-0006 auth for per-human sub-credentials (WP-0009-T02) 2026-07-30 14:26:33 +02:00
test_pilot_candidate_manifests.py Add info-tech-canon as first dry-run pilot candidate, exercise onboarding routine 2026-07-29 23:15:42 +02:00
test_registry_hosting.py Extend WP-0006 auth for per-human sub-credentials (WP-0009-T02) 2026-07-30 14:26:33 +02:00
test_trf_onboard.py Define and implement multi-repo onboarding mechanism (WP-0006-T07) 2026-07-29 22:00:34 +02:00