Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
298 changes: 22 additions & 276 deletions .console/backlog.md

Large diffs are not rendered by default.

3,079 changes: 52 additions & 3,027 deletions .console/log.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .custodian/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ src_root: src/operations_center
tests_root: tests

audit:
# .console/ reconciled (reconcile/console) — R1/R2 reconcile detectors active.
reconcile_enforce: true
# W2 (core.hooksPath must be set): developer-machine setup check, not applicable
# in CI where the repo is freshly cloned and git config is not persisted.
ignore_rules:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
!.console/validation/**
# P3: OC-local operational config and runtime state (migrated from .context/)
!.console/workers.yaml
# console-reconciliation: worksheet + any local archive staging stay untracked
/.console/reconcile.yaml
/.console/archive/
CLAUDE.md
.custodian/tmp*.yaml
__pycache__/
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Documentation
- Added `docs/design/observer-race-condition-guard.md` documenting the TOCTOU race condition vulnerability, the metadata capture guard mechanism, implementation examples, error handling strategy, testing approach, and operational impact.

### Reconciled
_Console history consolidated to the private archive (2026-06-04). Items shipped:_

- 2026-06-04: reconciled `unit-coverage-90-gate` — Unit coverage climb to a 90% gate (history archived).
- 2026-06-04: reconciled `observer-coverage-spec-authoring` — Spec authoring — observer test coverage campaign (history archived).
- 2026-06-04: reconciled `ci-coverage-threshold-gate` — Update CI/CD pipeline to gate on coverage threshold (Stages 0-4) (history archived).
- 2026-06-04: reconciled `export-validation-failure-metrics` — Export validation failure metrics for alerting (history archived).
- 2026-06-04: reconciled `import-error-test-refactor` — Import-error test refactoring (shared pytest fixtures) (history archived).
- 2026-06-04: reconciled `error-handling-documentation` — Error handling documentation (recipes, catalog, contracts, runbook) (history archived).
- 2026-06-04: reconciled `deriver-transition-coverage` — Deriver transition coverage (bidirectional, Stages 0-4) (history archived).
- 2026-06-04: reconciled `collector-json-hardening` — Collector JSON hardening (validation + security logging) (history archived).
- 2026-06-04: reconciled `switchboard-live-verification` — SwitchBoard live verification rev (deploy-skew bug + runbook) (history archived).
- 2026-06-04: reconciled `sourceregistry-real-wiring` — SourceRegistry — wire it for real (Option B, provenance propagation) (history archived).
- 2026-06-04: reconciled `platformdeployment-compose-profile-smoke` — WorkStation compose profile smoke per profile (history archived).
- 2026-06-04: reconciled `observability-config-skeleton` — Ship observability config skeleton (WorkStation (history archived).
- 2026-06-04: reconciled `oc-kodo-archon-cards-superseded` — OC — kodo + archon executor cards (superseded by team_executor) (history archived).
- 2026-06-04: reconciled `archon-workflow-registration-playbook` — Archon workflow registration playbook (history archived).
- 2026-06-04: reconciled `capacity-exhaustion-regression-fixture` — Capacity-exhaustion regression fixture (history archived).
- 2026-06-04: reconciled `oc-run-show-provenance-reader` — operations-center-run-show single-command provenance reader (history archived).
- 2026-06-04: reconciled `artifact-path-staleness-checks` — Artifact path staleness checks (history archived).
- 2026-06-04: reconciled `routing-rationale-completeness-smoke` — Routing rationale completeness smoke check (history archived).
- 2026-06-04: reconciled `opscenter-custodian-coverage-bridge` — OpsCenter <-> Custodian coverage bridge (history archived).
- 2026-06-04: reconciled `phase7-multi-run-artifact-index` — Phase 7 — multi-run historical artifact index + CLI (history archived).
- 2026-06-04: reconciled `phase6-dispatch-control-crash-safety` — Phase 6 — dispatch control crash-safety + dual-PID tracking (history archived).
- 2026-06-04: reconciled `effective-repo-graph-contract-impact-wiring` — EffectiveRepoGraph + contract impact wired into production (history archived).
- 2026-06-04: reconciled `archon-patch-001-upstream-pr-superseded` — File upstream PR for Archon PATCH-001 (superseded; archon removed) (history archived).
- 2026-06-04: reconciled `three-layer-manifest-primitive` — 3-layer manifest primitive — operationally complete (R1-R4) (history archived).
- 2026-06-04: reconciled `r5-cross-repo-task-chaining` — R5 — Cross-repo task chaining (propagation library + CLIs) (history archived).
- 2026-06-04: reconciled `er000-phase0-golden-tests` — ER-000 — Phase 0 golden tests (history archived).
- 2026-06-04: reconciled `er003-lifecycle-primitive` — ER-003 — Lifecycle primitive (history archived).
- 2026-06-04: reconciled `collector-json-hardening-stage2` — Collector JSON hardening — Stage 2 implementation (history archived).
- 2026-06-04: reconciled `managed-repo-audit-phases` — Managed-repo audit system — Phases 0-12 + verification passes (history archived).
- 2026-06-04: reconciled `cycle-board-unblock-housekeeping` — Cycle board-unblock + task housekeeping (operational) (history archived).
- 2026-06-04: reconciled `kodo-openclaw-regression-fix` — Fix kodo->openclaw regression in tests; CxRP 0.3.1 verdict bump (history archived).

30 changes: 15 additions & 15 deletions docs/architecture/managed-repos/audit_artifact_contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Purpose

This document defines the artifact contract between OperationsCenter and the managed repo for audit runs. OperationsCenter invokes the managed repo audit commands and reads the outputs; it never imports the managed repo Python code. The contract specifies exactly what files VF must produce, in what shape, so OpsCenter can ingest them without knowing VF internals.
This document defines the artifact contract between OperationsCenter and the managed repo for audit runs. OperationsCenter invokes the managed repo audit commands and reads the outputs; it never imports the managed repo Python code. The contract specifies exactly what files a private downstream repo must produce, in what shape, so OpsCenter can ingest them without knowing a private downstream repo internals.

---

Expand All @@ -20,7 +20,7 @@ OperationsCenter the managed repo
───────────────────────── ─────────────────────────
Defines contract schemas Implements contract schemas
Generates run_id (uuid4.hex) Receives run_id via $AUDIT_RUN_ID
Invokes VF commands Runs audit, writes contract files
Invokes a private downstream repo commands Runs audit, writes contract files
Reads run_status.json Writes run_status.json
Reads artifact_manifest.json Writes artifact_manifest.json
```
Expand All @@ -34,16 +34,16 @@ OpsCenter may only invoke commands and read files. No Python imports across the
The contract reflects findings from Phase 0 discovery (`<repo_id>_audit_ground_truth.md`):

- **Only one audit type (representative) has run_status finalization.** The five others (`enrichment`, `ideation`, `render`, `segmentation`, `stack_authoring`) write an initial `in_progress` status via `prepare_audit_bucket()` but never finalize it. Phase 5 must add finalization to all six.
- **No `artifact_manifest.json` exists yet.** The field `artifact_manifest_path` is absent from all current VF run_status files. The contract makes it `Optional[str]` to accept legacy files, but `is_compliant` returns `False` unless it is present.
- **Legacy status value:** VF currently emits `"in_progress"`. The contract canonicalizes running state as `"running"`. The enum value `IN_PROGRESS_LEGACY = "in_progress"` is accepted and marked non-compliant.
- **No `artifact_manifest.json` exists yet.** The field `artifact_manifest_path` is absent from all current a private downstream repo run_status files. The contract makes it `Optional[str]` to accept legacy files, but `is_compliant` returns `False` unless it is present.
- **Legacy status value:** a private downstream repo currently emits `"in_progress"`. The contract canonicalizes running state as `"running"`. The enum value `IN_PROGRESS_LEGACY = "in_progress"` is accepted and marked non-compliant.
- **stack_authoring output dir:** `tools/audit/report/authoring`, not `tools/audit/report/stack_authoring`. Phase 0 discovered this quirk.
- **Architecture invariants** are written to a fixed repo path, not per-run buckets.

---

## Phase 1 Managed Repo Relationship

The managed-repo config (`config/managed_repos/<repo_id>.yaml`, loaded by `managed_repos.loader`) tells OpsCenter how to invoke VF commands. This artifact contract defines what those commands produce. The two are complementary:
The managed-repo config (`config/managed_repos/<repo_id>.yaml`, loaded by `managed_repos.loader`) tells OpsCenter how to invoke a private downstream repo commands. This artifact contract defines what those commands produce. The two are complementary:

- Phase 1 config → how to invoke, where to look for outputs
- Phase 2 contract (this document) → what the output files must contain
Expand All @@ -57,7 +57,7 @@ The managed-repo config (`config/managed_repos/<repo_id>.yaml`, loaded by `manag
| Controlled vocabulary | `src/operations_center/audit_contracts/vocabulary.py` | `audit_contracts.vocabulary` |
| Run status model | `src/operations_center/audit_contracts/run_status.py` | `audit_contracts.run_status` |
| Artifact manifest model | `src/operations_center/audit_contracts/artifact_manifest.py` | `audit_contracts.artifact_manifest` |
| VF producer profile | `src/operations_center/audit_contracts/profiles/<repo_id>.py` | `audit_contracts.profiles` |
| managed-repo producer profile | `src/operations_center/audit_contracts/profiles/<repo_id>.py` | `audit_contracts.profiles` |
| JSON schemas | `schemas/audit_contracts/` | generated from Pydantic |
| Examples | `examples/audit_contracts/` | validated against models |

Expand All @@ -82,15 +82,15 @@ The vocabulary is split into two explicit layers:
| `ValidFor` | `current_run_only`, `cross_run_comparison`, `latest_snapshot`, `historical_record`, `partial_run_analysis`, `unknown` |
| `Limitation` | `partial_run`, `missing_downstream_artifacts`, `producer_not_finalized`, `non_representative_audit_unverified`, `repo_singleton_overwritten`, `infrastructure_noise_excluded`, `path_layout_non_uniform`, `unknown` |

**the managed repo profile enums** (VF-specific, in `VIDEOFOUNDRY_PROFILE_ENUMS`):
**the managed repo profile enums** (managed-repo-specific, in `MANAGED_PROFILE_ENUMS`):

| Enum | Description |
|------|-------------|
| `the managed repoAuditType` | Six audit types: `representative`, `enrichment`, `ideation`, `render`, `segmentation`, `stack_authoring` |
| `the managed repoSourceStage` | Known stage names from Phase 0 (TopicSelectionStage, etc.) |
| `the managed repoArtifactKind` | Artifact kinds: `run_status`, `stage_report`, `audit_report`, `architecture_invariant`, etc. |

`GENERIC_ENUMS` and `VIDEOFOUNDRY_PROFILE_ENUMS` are disjoint tuples enforced by tests.
`GENERIC_ENUMS` and `MANAGED_PROFILE_ENUMS` are disjoint tuples enforced by tests.

---

Expand All @@ -107,7 +107,7 @@ Required fields:
| `producer` | `str` | e.g. `"<repo_id>"` |
| `repo_id` | `str` | e.g. `"<repo_id>"` |
| `run_id` | `str` | uuid4().hex, injected by OpsCenter via `$AUDIT_RUN_ID` |
| `audit_type` | `str` | one of the six VF audit types |
| `audit_type` | `str` | one of the six a private downstream repo audit types |
| `status` | `RunStatus` | current run state |

Optional but contract-required for compliance:
Expand Down Expand Up @@ -270,7 +270,7 @@ the managed repo must implement these changes for `is_compliant` to return `True
5. **Populate `excluded_paths`** in each manifest with the known infrastructure noise patterns.
6. **Include the repo singleton** in the manifest for representative runs.

Until Phase 5, OpsCenter treats all VF run_status files as legacy (`is_compliant = False`) and reads them in read-only diagnostic mode.
Until Phase 5, OpsCenter treats all a private downstream repo run_status files as legacy (`is_compliant = False`) and reads them in read-only diagnostic mode.

---

Expand All @@ -289,7 +289,7 @@ OTHER_PROFILE = the managed repoProducerProfile(
)
```

The generic contract models (ManagedRunStatus, ManagedArtifactManifest) are unchanged. The boundary enforcement test (`TestBoundaryEnforcement`) uses Python AST to verify the audit_contracts package never imports VF code.
The generic contract models (ManagedRunStatus, ManagedArtifactManifest) are unchanged. The boundary enforcement test (`TestBoundaryEnforcement`) uses Python AST to verify the audit_contracts package never imports a private downstream repo code.

---

Expand All @@ -298,15 +298,15 @@ The generic contract models (ManagedRunStatus, ManagedArtifactManifest) are unch
| Layer | What it contains | Who can use it |
|-------|-----------------|----------------|
| Generic contract | RunStatus, ManifestStatus, Location, ManagedRunStatus, ManagedArtifactManifest | Any managed repo |
| VF producer profile | the managed repoAuditType, the managed repoAuditTypeSpec, VIDEOFOUNDRY_PROFILE | the managed repo only |
| managed-repo producer profile | the managed repoAuditType, the managed repoAuditTypeSpec, MANAGED_PROFILE | the managed repo only |

`GENERIC_ENUMS` and `VIDEOFOUNDRY_PROFILE_ENUMS` tuples are exported from `vocabulary.py` to allow tests to assert the layers are disjoint.
`GENERIC_ENUMS` and `MANAGED_PROFILE_ENUMS` tuples are exported from `vocabulary.py` to allow tests to assert the layers are disjoint.

---

## Non-Goals

- OpsCenter does not validate artifact file contents — only the manifest metadata.
- OpsCenter does not write `run_status.json` or `artifact_manifest.json` — VF writes them.
- The contract does not specify how VF internally structures its stages or pipeline.
- OpsCenter does not write `run_status.json` or `artifact_manifest.json` — a private downstream repo writes them.
- The contract does not specify how a private downstream repo internally structures its stages or pipeline.
- OpsCenter does not import any the managed repo Python code at any point.
4 changes: 2 additions & 2 deletions docs/architecture/managed-repos/audit_ground_truth.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ No schemas were created. No implementation was changed. No contracts were design
## Repositories Inspected

- `the managed repo` — audit runner, artifact producer
- `OperationsCenter` — contract owner (no VF code imported; only files read)
- `OperationsCenter` — contract owner (no a private downstream repo code imported; only files read)

---

Expand Down Expand Up @@ -207,7 +207,7 @@ tools/audit/report/architecture_invariants/warning_triage.md
"summary": { "pass": 41, "warn": 190, "fail": 0, "known_legacy": 7 },
"findings": [
{
"id": "VF-ARCH-LAYER-001",
"id": "MANAGED-ARCH-LAYER-001",
"family": "layer_direction",
"severity": "warn",
"status": "known_legacy",
Expand Down
2 changes: 1 addition & 1 deletion docs/history/managed-repo/managed_repo_artifact_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Artifact paths in the manifest may be absolute or relative. Phase 7 resolves the
| Relative path, no `repo_root` | Derive root from manifest position + `run_root` depth. |
| Derivation fails | `resolved_path = None`. |

**Derivation heuristic**: the manifest file lives at `{repo_root}/{run_root}/artifact_manifest.json`. The builder steps up `len(run_root.parts)` parent directories from `manifest_dir` to obtain `repo_root`. This works for standard VF bucket layouts.
**Derivation heuristic**: the manifest file lives at `{repo_root}/{run_root}/artifact_manifest.json`. The builder steps up `len(run_root.parts)` parent directories from `manifest_dir` to obtain `repo_root`. This works for standard a private downstream repo bucket layouts.

If a path cannot be safely resolved, it is marked `resolved_path = None` and `exists_on_disk = None`. The caller receives a clear signal rather than a guess.

Expand Down
2 changes: 1 addition & 1 deletion docs/history/managed-repo/managed_repo_audit_dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ managed private project (Phase 5) writes contract files to the audit bucket:
- `run_status.json` — Phase 2 schema, includes `artifact_manifest_path`.
- `artifact_manifest.json` — Phase 2 schema, lists all artifacts.

Phase 6 reads these files after process exit. The `artifact_manifest_path` field in `run_status.json` is a path relative to the VF repo root. Phase 6 resolves it using `base_dir=working_dir_abs` (the VF repo root).
Phase 6 reads these files after process exit. The `artifact_manifest_path` field in `run_status.json` is a path relative to the a private downstream repo repo root. Phase 6 resolves it using `base_dir=working_dir_abs` (the a private downstream repo repo root).

---

Expand Down
Loading
Loading