video_agent_trace / videoagent /docs /architecture.md
ppppppz's picture
Add VideoAgent docs, text-only data, results, and implementation bundle
6502024 verified
|
Raw History Blame Contribute Delete
4.55 kB
# TraceRepair-Agent V1 architecture
## Trust boundary
The benchmark has three composition roots. This is a security property, not a
convention.
```text
InjectionRuntime (private) RepairRuntime (public only)
clean assets + error spec opaque corrupted project
| |
v v
candidate injection blind repair controller
| |
v v
accept/reject + provenance repaired revision + trace
| |
+-------------+ +---------------------+
| |
v v
EvaluationRuntime (offline/private)
canonical ledger + public result
```
`RepairRuntime` must never hold a private manifest repository, injection prompt,
clean target asset, seed, target error label, or canonical ledger. Opaque case
identifiers must not encode an error family. Static import tests and manifest
schema tests enforce the boundary before any model endpoint is integrated.
## Domain invariants
1. Missing evidence produces `INCONCLUSIVE`, never a fabricated violation.
2. The detector localizes the earliest causal divergence, not merely the first
low-confidence frame in wall-clock order.
3. The policy vocabulary is closed to `KEEP`, `H3_EDIT`, and
`SHOT_REGENERATE` in V1.
4. Inspection, reinspection, verification, commit, retry, and rollback are
workflow transitions, not repair actions.
5. Every mutation creates a new asset and project revision. Rollback moves the
accepted pointer to an earlier immutable revision; it never deletes history.
6. Operational verification uses public evidence only. Private evaluation is a
distinct port and runs after the repair process.
7. A retry consumes generation budget. V1 defaults to at most three generation
calls per case.
8. A rejected candidate is never promoted as the final repaired project. Scores
rank only candidates that passed every critical verification gate; if none
pass, the accepted pointer returns to the original accepted revision.
## Blind repair state machine
```text
CREATED -> INSPECTING -> LEDGER_READY -> DIAGNOSING -> PLANNING
|
+------------- KEEP ------------------------+
| |
| H3_EDIT / SHOT_REGENERATE v
| GENERATING
| |
| v
+-------------------------------------- VERIFYING
|
accept -> COMMITTED <---------+
reject -> retry if budget remains
reject -> ROLLBACK_ORIGINAL / FAILED otherwise
```
The controller journals every transition and candidate. Candidate revisions are
not accepted until the operational verifier passes the target correction,
protected facts, cross-shot coherence, visual quality, and naturalness gates.
V1 samples at most three immutable candidate branches. It reports Pass@1,
private Oracle Pass@3, and blind-verifier Select@3 separately so generator
coverage is not confused with verifier selection quality. See ADR-0003.
## Narrative error detector
The detector compiles the public brief, shot plan, and references into an
expected event/state graph. A separate inspector extracts timestamp-grounded
observations from the corrupted shots. Deterministic alignment and constraint
evaluation then produce `SATISFIED`, `VIOLATED`, or `INCONCLUSIVE`. If the
result is inconclusive, the system requests a narrow second inspection over the
missing entity, boundary, or timestamp window before selecting a repair action.
Model output is treated as a proposal. It may extract observations or draft
constraints, but it does not get to declare that an error exists without
evidence accepted by the deterministic core.
## Framework adaptation
From ViMax v1.2.0 we adapt the small typed tool registry, bounded loop,
provider-facing protocols, persistent session idea, and artifact checklist. We
replace weak file-existence reuse with full hashes and explicit revisions; add
commit/rollback semantics; make stale dependency handling explicit; and split
benchmark truth from the repair runtime.