Phase 2: Introduce Timeline domain class in ArtAgents
Goal
Replace ad-hoc json.load/json.dump on hype.timeline.json across ArtAgents with a Timeline domain class that makes the current correctness discipline into a class invariant. This unblocks Phase 3 (collapsing source-cut and pure-generative pipelines into one).
Repo
/Users/user_c042661f/Documents/reigh-workspace/ArtAgents — currently on main at commit d58b4fa. Push directly to main (small project, this workflow is established).
User's working tree has uncommitted SKILL.md → STAGE.md rename work — must not be touched. Stash before working, restore after.
What just happened (context the planner needs)
Phase 1 just landed (commit 5cb7e81): deleted bin/ (30 wrappers), migrated pipeline subprocess to module form, deleted dead orchestrator-registry factories, cleaned docs. -430 LOC.
Prereq A landed (0524c5c on sprint-8-themed-render-via-orchestrator branch in /Users/user_c042661f/Documents/banodoco-workspace/packages/timeline-schema): output.background and output.background_scale now accept null in the shared @banodoco/timeline-schema package. Reigh + ArtAgents pick this up via symlink.
Prereq B landed (commit d58b4fa on ArtAgents main): tests/test_timeline_roundtrip_fixture.py with three assertions:
Byte-equivalent round-trip on examples/hype.timeline.full.json — passes today
Allowlist parity with shared schema — passes today
Unknown top-level field preservation — xfails today (Phase 2 should flip to xpass and the marker gets removed)
Design constraints from the Reigh compatibility analysis
The timeline shape is shared with the Reigh editor via @banodoco/timeline-schema. The Phase 2 design must respect:
Do NOT add clip.kind as a persisted field. Reigh's clip allowlist () is closed and throws on unknown clip keys. ArtAgents' matches it byte-equivalent. Any "kind" must be a runtime-derived view, not persisted.
Assistant
{"output":"Using the artagents skill for repo-specific guardrails before touching the worktree.","files_changed":[],"commands_run":[],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"I recorded the starting branch and HEAD. The dirty state is the expected broad SKILL/STAGE rename set plus one untracked file, so I’m inspecting that before stashing anything.","files_changed":[],"commands_run":["sed -n '1,220p' /Users/user_c042661f/Documents/reigh-workspace/ArtAgents/SKILL.md","pwd","git branch --show-current","git rev-parse HEAD","git status --short --branch"],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"I’m stashing the tracked rename work separately from the stray untracked zero-byte .test_write, so the named SKILL/STAGE stash is auditable on its own and the worktree can be clean for the later Timeline batch.","files_changed":[],"commands_run":["git status --porcelain=v1 -uall","git diff --stat","git diff --cached --stat","ls -l .test_write","git stash list --date=local --max-count=5"],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"The rename stash is now isolated and the repo status is clean on main at d58b4fa. I’m checking the batch checkpoint target and will record only the T1/SC1 completion there if it is writable.","files_changed":[],"commands_run":["git stash push -m "phase2-timeline-protect-skill-stage-rename-work"","git status --short --branch","git stash show --name-status stash@{0}","git stash list --date=local --max-count=3","git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write","git status --short --branch","git stash list --date=local --max-count=5","git stash show --name-status stash@{1}","git stash show --include-untracked --name-status stash@{0}","git rev-parse --abbrev-ref HEAD && git rev-parse HEAD"],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
User
Assistant
User
Assistant
{"output":"I’m editing only artagents/timeline.py for T3: adding the Timeline persisted-data wrapper, routing the old load/save shims through it, and loosening only the top-level passthrough behavior while leaving clip/track checks strict.","files_changed":[],"commands_run":[],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
User
Assistant
{"output":"I’m adding two runtime views in timeline.py: a clip view for classification that never writes fields back to JSON, and a render view that can materialize a default theme for props without mutating or becoming a persistence object.","files_changed":["artagents/timeline.py"],"commands_run":[],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"I’m wiring the render executor to consume the new render view for props serialization, so default theme injection stays in render-time JSON instead of in persisted timeline files.","files_changed":["artagents/timeline.py"],"commands_run":[],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
User
Assistant
{"output":"I found the remaining timeline-specific raw JSON paths in validate, refine, event_talks packaging, and open_in_reigh SQL export. I’m routing just those timeline reads/writes through Timeline/load_timeline/save_timeline; paired assets/metadata reads stay for T7.","files_changed":["artagents/timeline.py","artagents/executors/render/run.py"],"commands_run":["rg "hype\.timeline\.json|load_timeline|save_timeline|json\.load|json\.loads|write_text\(json\.dumps" artagents -n","rg "hype\.timeline\.json" artagents -n"],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
.for_render() default-theme injection must be transient. Reigh routinely persists timelines without a theme and uses its own renderer-side fallback (reigh-app/.../renderRouter.ts:194-199). If ArtAgents writes back a defaulted theme, Reigh users see a silent theme switch on next load. Default-theme is a render-time view, never round-trips to disk.
The shared schema is the source of truth.artagents/timeline.py:30,858 already validates against the package's JSON Schema (_shared_validate_timeline). Phase 2 should keep using that, not maintain a separate Python allowlist.
Round-trip must remain byte-equivalent. The Prereq B fixture test is the regression gate.
What the Timeline class should be
Owns load/dump. Construction reads JSON, dump writes JSON.
Preserves unknown top-level fields by construction (the _phase2_canary xfail in Prereq B should flip to passing, and the xfail marker should be removed).
.for_render() returns a transient view with theme defaulted to a renderable value if missing. Never mutates self. Never round-trips.
Exposes typed access to known fields (.theme, .clips, .tracks, .theme_overrides, .generation_defaults, .pinnedShotGroups, .output).
Provides a runtime clip.classified_kind (or equivalent) computed from clipType + asset registry MIME — for internal dispatch only, never persisted. Should include an OPAQUE arm for unknown clipTypes (Reigh's clipType is intentionally open-string).
Direct json.load of hype.timeline.json becomes the wrong way to do it everywhere. The migration scope is roughly ~12 executors that touch timelines (cut, arrange, refine, render, validate, editor_review, human_notes, inspect_cut, plus anything in pipeline.py that reads/writes timeline JSON directly).
Find the actual scope by grepping for hype.timeline.json and load_timeline/save_timeline callers.
Success criteria
tests/test_timeline_roundtrip_fixture.py::test_unknown_top_level_field_is_preserved flips from xfail to xpass; the xfail marker is removed (now an unconditional pass).
The other two roundtrip-fixture tests still pass.
The full test suite passes (excluding the two pre-existing failures: tests/test_pool_schema.py and tests/test_cut_timeline_resume.py::test_resume_mode_render_smoke).
python3 -m artagents orchestrators list and python3 -m artagents executors list still work.
End-to-end: a hype pipeline --dry-run smoke completes without error.
Direct json.load of hype.timeline.json (or hype.assets/hype.metadata) is gone from the executor code paths — every read goes through the Timeline class. Grep is the test.
No new persisted fields in clips/tracks/timeline (allowlist parity test still passes).
.for_render()'s injected theme never appears in any saved JSON file (write a test for this).
Out of scope for Phase 2
Don't collapse the source-cut vs pure-generative pipelines (that's Phase 3, depends on this).
Don't change the schema package itself (handled in Prereq A, on the sprint branch).
Don't touch Pool / AssetRegistry — same pattern probably applies but defer until Timeline proves out.
Don't rewrite docs beyond what's needed for the migration (no SKILL.md expansion — user wants those terse).
Working notes
The Prereq B test file is the canary — re-run it after each meaningful step.
Commit messages should be focused; multiple commits over one mega-commit is fine for this size.
ArtAgents pyenv is 3.11.11. Pytest available via pytest shim. To run: pytest tests/ -q --ignore=tests/test_pool_schema.py --ignore=tests/test_cut_timeline_resume.py.
The python command in this shell requires PYENV_VERSION=3.11.11 python ..., but python3 works directly.
code
Batch framing:
- Execute batch 1 of 8.
- Actionable task IDs for this batch: ['T1']
- Already completed task IDs available as dependency context: []
Actionable tasks for this batch:
[
{
"id": "T1",
"description": "Protect the existing user work before editing: record branch, HEAD, and dirty state; inspect untracked files; stash the SKILL.md -> STAGE.md rename work with a clearly named stash entry; confirm the stash contains only that user work and the repo is clean for Timeline edits.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[]
Prior batch deviations (address if applicable):
None
User action prerequisites:
No user_action prerequisites for this batch.
Batch-scoped sense checks:
[
{
"id": "SC1",
"task_id": "T1",
"question": "Was the pre-existing SKILL/STAGE rename work captured in a named stash, with branch/HEAD/dirty state recorded and no unrelated Timeline edits made before the stash?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Protect the existing user work before editing: record branch, HEAD, and dirty state; inspect untracked files; stash the SKILL.md -> STAGE.md rename work with a clearly named stash entry; confirm the stash contains only that user work and the repo is clean for Timeline edits.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Run baseline checks before code changes: pytest tests/test_timeline_roundtrip_fixture.py -q, python3 -m artagents orchestrators list, and python3 -m artagents executors list. Record the expected xfail state for unknown top-level field preservation before changing it.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Implement the Timeline domain class in artagents/timeline.py. It must own persisted JSON load/dump, preserve unknown top-level fields, keep clip/track validation strict, continue using the shared JSON Schema, allow persisted timelines with no theme, expose typed properties for known fields, centralize from_/from JSON boundary conversion, and keep load_timeline() / save_timeline() as compatibility shims backed by the class.",
"depends_on": [
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Add runtime-only clip classification to the Timeline API. Derive classified_kind from clipType plus asset registry MIME/type, include an OPAQUE arm for unknown open-string clip types, and ensure no derived kind or classification fields can appear in persisted clip JSON.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add the transient render view API. Timeline.for_render(default_theme=\"banodoco-default\") must return a render-ready view where missing theme resolves to the default, without mutating the source Timeline and without making that injected theme dumpable back to persisted JSON. Move render JSON serialization details currently duplicated in the render executor into the Timeline API where appropriate.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T6",
"description": "Migrate executor and pipeline consumers of hype.timeline.json to the Timeline API or its compatibility shims. Cover the actual grep-discovered scope, including validate, refine, render, cut, publish, enriched arrangement, and pipeline reads/writes where applicable, while preserving existing behavior and byte-equivalent serialization.",
"depends_on": [
"T3",
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T7",
"description": "Migrate direct executor reads of paired Hype artifacts included in the grep gate: replace raw reads of hype.assets.json with artagents.timeline.load_registry(...) where validation is appropriate, and raw reads of hype.metadata.json with artagents.timeline.load_metadata(...). Do not broaden this into Pool, arrangement, transcript, scene, source media, or docs work.",
"depends_on": [
"T6"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T8",
"description": "Update tests for Phase 2 behavior. Remove the xfail marker from test_unknown_top_level_field_is_preserved; add or adjust focused tests proving unknown top-level preservation through Timeline and compatibility shims, missing-theme load/dump without persisted default injection, .for_render() transient theme behavior, and runtime-only clip classification with opaque unknown clip types. Keep allowlist parity unchanged.",
"depends_on": [
"T3",
"T4",
"T5",
"T6",
"T7"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T9",
"description": "Run final verification, fix failures, commit, push, and restore user work. Required checks: pytest tests/test_timeline_roundtrip_fixture.py -q; relevant focused executor tests after inspecting changed files; grep gate proving executor code no longer directly JSON-loads hype.timeline.json, hype.assets.json, or hype.metadata.json; broad suite using the documented exclusions but deselect only tests/test_cut_timeline_resume.py::CutTimelineResumeTest::test_resume_mode_render_smoke instead of ignoring the whole file if possible; python3 -m artagents orchestrators list; python3 -m artagents executors list; and a builtin.hype dry-run smoke after checking current syntax in artagents/orchestrators/hype/STAGE.md. Also write a short throwaway script under an ignored temp location that reproduces the missing-theme/unknown-top-level round-trip bug, run it to confirm the fix, then delete it. Commit focused changes, push directly to main, apply the saved user stash, and confirm the original SKILL/STAGE rename work is back in the working tree.",
"depends_on": [
"T8"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
],
"watch_items": [
"Do not invoke the megaplan CLI, read the megaplan skill, or start nested planning harnesses.",
"Start from /Users/user_c042661f/Documents/reigh-workspace/ArtAgents on main; push directly to main only after validation.",
"User SKILL.md -> STAGE.md rename work is unrelated and must be stashed before edits, untouched during implementation, and restored after pushing.",
"Do not infer read-only state. Attempt required edits and only report write failure after a concrete OS-level rejection and retry.",
"Do not persist clip.kind or any derived classification field. Reigh has a closed clip key allowlist and will reject unknown persisted keys.",
"Default theme injection is render-time only. .for_render() may expose a theme, but saved Timeline JSON must not gain a defaulted theme field.",
"Shared @banodoco/timeline-schema remains the schema source of truth. Avoid maintaining a new Python top-level allowlist for persisted Timeline fields.",
"Unknown top-level Timeline fields must be preserved, while clip and track unknown-key checks remain strict.",
"clipType is open-string; unknown values should classify as opaque rather than fail purely because the string is unfamiliar.",
"FLAG-003 remains open: avoid hiding regressions by ignoring all of tests/test_cut_timeline_resume.py; deselect only the documented pre-existing smoke failure if the test runner supports it.",
"Do not migrate Pool, AssetRegistry internals, arrangement, transcript, scene, source media, or broad docs beyond the named Hype artifact gate.",
"Round-trip byte equivalence for examples/hype.timeline.full.json is a hard regression gate.",
"Grep success criterion covers executor code paths for direct JSON reads of hype.timeline.json, hype.assets.json, and hype.metadata.json, not every unrelated JSON helper in the repo."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Was the pre-existing SKILL/STAGE rename work captured in a named stash, with branch/HEAD/dirty state recorded and no unrelated Timeline edits made before the stash?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Do the baseline roundtrip fixture and CLI list commands establish the current behavior, including the expected unknown-top-level preservation xfail before Phase 2 edits?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does Timeline.load().dump() preserve unknown top-level fields, allow a missing persisted theme, keep shared-schema validation, and keep clip/track validation closed without changing persisted field allowlists?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Is clip classification derived only at runtime from clipType and registry MIME/type, with unknown clip types mapped to OPAQUE and no kind field written to JSON?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does .for_render() expose a renderable default theme when needed while leaving the original Timeline unchanged and unable to dump the injected theme?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Have all grep-discovered hype.timeline.json executor/pipeline reads and writes been routed through Timeline, load_timeline(), or save_timeline() without changing byte-equivalent output?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC7",
"task_id": "T7",
"question": "Are direct executor reads of hype.assets.json and hype.metadata.json migrated to typed loaders, with unrelated JSON artifacts left alone?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC8",
"task_id": "T8",
"question": "Do tests now assert unconditional unknown-top-level preservation, missing-theme persistence, transient render theme behavior, runtime-only classification, and unchanged allowlist parity?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC9",
"task_id": "T9",
"question": "Do the targeted tests, grep gate, broad suite with only documented exclusions, CLI smokes, hype dry-run smoke, and throwaway reproduction script all pass before commit/push, and is the user stash restored afterward?",
"executor_note": "",
"verdict": ""
}
],
"user_actions": [],
"meta_commentary": "Execution should proceed in a tight loop: protect user work first, prove the current baseline, implement Timeline invariants, then migrate consumers only as far as the named Hype artifact gate requires. The key design judgment is to separate persisted compatibility from render readiness: persisted timelines may omit theme and carry unknown top-level keys, while render views can inject defaults transiently. Keep JSON boundary mechanics in artagents/timeline.py; executor changes should become simpler, not grow new local serializers. Treat FLAG-003 as a validation refinement: the known bad smoke test can be deselected, but the rest of tests/test_cut_timeline_resume.py is relevant to this phase and should run if feasible.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Protect user work and establish baseline",
"finalize_item_ids": [
"T1",
"T2"
]
},
{
"plan_step_summary": "Step 2: Add Timeline with persisted-vs-render validation",
"finalize_item_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 3: Add runtime clip classification",
"finalize_item_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 4: Implement transient render view and update render executor serialization",
"finalize_item_ids": [
"T5",
"T6"
]
},
{
"plan_step_summary": "Step 5: Migrate Hype artifact consumers in executor paths",
"finalize_item_ids": [
"T6",
"T7"
]
},
{
"plan_step_summary": "Step 6: Update tests for Phase 2 behavior",
"finalize_item_ids": [
"T8"
]
},
{
"plan_step_summary": "Step 7: Validate broadly and commit",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Execution order 1: Stash user work before touching files",
"finalize_item_ids": [
"T1"
]
},
{
"plan_step_summary": "Execution order 2: Add Timeline with persisted-vs-render validation first",
"finalize_item_ids": [
"T3"
]
},
{
"plan_step_summary": "Execution order 3: Add tests for unknown fields, missing theme, transient render theme, and classification",
"finalize_item_ids": [
"T8"
]
},
{
"plan_step_summary": "Execution order 4: Migrate timeline and paired Hype artifact reads after class behavior is proven",
"finalize_item_ids": [
"T6",
"T7",
"T8"
]
},
{
"plan_step_summary": "Execution order 5: Run grep-based checks before broad tests",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Execution order 6: Push Timeline commits, then restore user uncommitted work",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 1: Run pytest tests/test_timeline_roundtrip_fixture.py -q",
"finalize_item_ids": [
"T2",
"T9"
]
},
{
"plan_step_summary": "Validation order 2: Run focused Timeline and executor tests around render, validate, refine, cut, and publish serialization",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 3: Grep for direct JSON loads of named Hype artifacts in executor code paths",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 4: Run broad suite with documented exclusions",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 5: Run CLI list checks and hype dry-run smoke",
"finalize_item_ids": [
"T2",
"T9"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All approved main phase, execution order, and validation order steps are mapped. No human-only actions are required because the executor has writable repo access and the requested push/restore/test work is operational repo work, not an out-of-band human dependency. The only deliberate adjustment is to address FLAG-003 by running the non-smoke cut resume tests where feasible instead of ignoring the entire file.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Expected baseline includes the current xfail for unknown top-level Timeline field preservation before implementation; after Phase 2 the xfail marker must be removed and the test must pass unconditionally."
}
code
Debt watch items (do not make these worse):
None.
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T1]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC1]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/ArtAgents/.megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_1.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
{"output":"T1 complete. Recorded starting state, isolated the SKILL.md -> STAGE.md rename work in a named stash, separately stashed the zero-byte untracked .test_write, and confirmed the repository is clean on main at d58b4fae819ab0676cb723e9bfc67c3d5f2b2b72 before any Timeline edits.","files_changed":[],"commands_run":["sed -n '1,220p' /Users/user_c042661f/Documents/reigh-workspace/ArtAgents/SKILL.md","pwd","git branch --show-current","git rev-parse HEAD","git status --short --branch","git status --porcelain=v1 -uall","git diff --stat","git diff --cached --stat","ls -l .test_write","git stash list --date=local --max-count=5","git stash push -m "phase2-timeline-protect-skill-stage-rename-work"","git status --short --branch","git stash show --name-status stash@{0}","git stash list --date=local --max-count=3","git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write","git status --short --branch","git stash list --date=local --max-count=5","git stash show --name-status stash@{1}","git stash show --include-untracked --name-status stash@{0}","git rev-parse --abbrev-ref HEAD && git rev-parse HEAD","ls -l .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_1.json","test -w .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_1.json; printf '%s\n' $?"],"deviations":["Best-effort checkpoint was not written because .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_1.json does not exist and is not writable."],"task_updates":[{"task_id":"T1","status":"done","executor_notes":"Starting state recorded: cwd /Users/user_c042661f/Documents/reigh-workspace/ArtAgents, branch main, HEAD d58b4fae819ab0676cb723e9bfc67c3d5f2b2b72. Initial dirty state was the broad SKILL.md -> STAGE.md rename work plus an untracked zero-byte .test_write. Created named stash phase2-timeline-protect-skill-stage-rename-work; verified it contains tracked rename/doc/test support changes only via git stash show --name-status stash@{1}. Created separate stash phase2-timeline-protect-untracked-test-write for .test_write; verified with git stash show --include-untracked --name-status stash@{0}. Final git status --short --branch is clean: ## main...origin/main. No Timeline edits were made.","files_changed":[],"commands_run":["git branch --show-current","git rev-parse HEAD","git status --short --branch","git status --porcelain=v1 -uall","git diff --stat","git diff --cached --stat","ls -l .test_write","git stash push -m "phase2-timeline-protect-skill-stage-rename-work"","git stash show --name-status stash@{1}","git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write","git stash show --include-untracked --name-status stash@{0}","git status --short --branch"],"auto_attributed_files":false}],"sense_check_acknowledgments":[{"sense_check_id":"SC1","executor_note":"Yes. The pre-existing SKILL/STAGE rename work was captured before Timeline edits in named stash phase2-timeline-protect-skill-stage-rename-work; branch/HEAD/dirty state were recorded; the only untracked file was inspected and separately stashed; final worktree is clean."}]}
Phase 2: Introduce Timeline domain class in ArtAgents
Goal
Replace ad-hoc json.load/json.dump on hype.timeline.json across ArtAgents with a Timeline domain class that makes the current correctness discipline into a class invariant. This unblocks Phase 3 (collapsing source-cut and pure-generative pipelines into one).
Repo
/Users/user_c042661f/Documents/reigh-workspace/ArtAgents — currently on main at commit d58b4fa. Push directly to main (small project, this workflow is established).
User's working tree has uncommitted SKILL.md → STAGE.md rename work — must not be touched. Stash before working, restore after.
What just happened (context the planner needs)
Phase 1 just landed (commit 5cb7e81): deleted bin/ (30 wrappers), migrated pipeline subprocess to module form, deleted dead orchestrator-registry factories, cleaned docs. -430 LOC.
Prereq A landed (0524c5c on sprint-8-themed-render-via-orchestrator branch in /Users/user_c042661f/Documents/banodoco-workspace/packages/timeline-schema): output.background and output.background_scale now accept null in the shared @banodoco/timeline-schema package. Reigh + ArtAgents pick this up via symlink.
Prereq B landed (commit d58b4fa on ArtAgents main): tests/test_timeline_roundtrip_fixture.py with three assertions:
Byte-equivalent round-trip on examples/hype.timeline.full.json — passes today
Allowlist parity with shared schema — passes today
Unknown top-level field preservation — xfails today (Phase 2 should flip to xpass and the marker gets removed)
Design constraints from the Reigh compatibility analysis
The timeline shape is shared with the Reigh editor via @banodoco/timeline-schema. The Phase 2 design must respect:
Do NOT add clip.kind as a persisted field. Reigh's clip allowlist (reigh-app/src/tools/video-editor/lib/serialize.ts:8-42) is closed and throws on unknown clip keys. ArtAgents' _CLIP_ALLOWED matches it byte-equivalent. Any "kind" must be a runtime-derived view, not persisted.
.for_render() default-theme injection must be transient. Reigh routinely persists timelines without a theme and uses its own renderer-side fallback (reigh-app/.../renderRouter.ts:194-199). If ArtAgents writes back a defaulted theme, Reigh users see a silent theme switch on next load. Default-theme is a render-time view, never round-trips to disk.
The shared schema is the source of truth.artagents/timeline.py:30,858 already validates against the package's JSON Schema (_shared_validate_timeline). Phase 2 should keep using that, not maintain a separate Python allowlist.
Round-trip must remain byte-equivalent. The Prereq B fixture test is the regression gate.
What the Timeline class should be
Owns load/dump. Construction reads JSON, dump writes JSON.
Preserves unknown top-level fields by construction (the _phase2_canary xfail in Prereq B should flip to passing, and the xfail marker should be removed).
.for_render() returns a transient view with theme defaulted to a renderable value if missing. Never mutates self. Never round-trips.
Exposes typed access to known fields (.theme, .clips, .tracks, .theme_overrides, .generation_defaults, .pinnedShotGroups, .output).
Provides a runtime clip.classified_kind (or equivalent) computed from clipType + asset registry MIME — for internal dispatch only, never persisted. Should include an OPAQUE arm for unknown clipTypes (Reigh's clipType is intentionally open-string).
Direct json.load of hype.timeline.json becomes the wrong way to do it everywhere. The migration scope is roughly ~12 executors that touch timelines (cut, arrange, refine, render, validate, editor_review, human_notes, inspect_cut, plus anything in pipeline.py that reads/writes timeline JSON directly).
Find the actual scope by grepping for hype.timeline.json and load_timeline/save_timeline callers.
Success criteria
tests/test_timeline_roundtrip_fixture.py::test_unknown_top_level_field_is_preserved flips from xfail to xpass; the xfail marker is removed (now an unconditional pass).
The other two roundtrip-fixture tests still pass.
The full test suite passes (excluding the two pre-existing failures: tests/test_pool_schema.py and tests/test_cut_timeline_resume.py::test_resume_mode_render_smoke).
python3 -m artagents orchestrators list and python3 -m artagents executors list still work.
End-to-end: a hype pipeline --dry-run smoke completes without error.
Direct json.load of hype.timeline.json (or hype.assets/hype.metadata) is gone from the executor code paths — every read goes through the Timeline class. Grep is the test.
No new persisted fields in clips/tracks/timeline (allowlist parity test still passes).
.for_render()'s injected theme never appears in any saved JSON file (write a test for this).
Out of scope for Phase 2
Don't collapse the source-cut vs pure-generative pipelines (that's Phase 3, depends on this).
Don't change the schema package itself (handled in Prereq A, on the sprint branch).
Don't touch Pool / AssetRegistry — same pattern probably applies but defer until Timeline proves out.
Don't rewrite docs beyond what's needed for the migration (no SKILL.md expansion — user wants those terse).
Working notes
The Prereq B test file is the canary — re-run it after each meaningful step.
Commit messages should be focused; multiple commits over one mega-commit is fine for this size.
ArtAgents pyenv is 3.11.11. Pytest available via pytest shim. To run: pytest tests/ -q --ignore=tests/test_pool_schema.py --ignore=tests/test_cut_timeline_resume.py.
The python command in this shell requires PYENV_VERSION=3.11.11 python ..., but python3 works directly.
code
Batch framing:
- Execute batch 2 of 8.
- Actionable task IDs for this batch: ['T2']
- Already completed task IDs available as dependency context: ['T1']
Actionable tasks for this batch:
[
{
"id": "T2",
"description": "Run baseline checks before code changes: pytest tests/test_timeline_roundtrip_fixture.py -q, python3 -m artagents orchestrators list, and python3 -m artagents executors list. Record the expected xfail state for unknown top-level field preservation before changing it.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Protect the existing user work before editing: record branch, HEAD, and dirty state; inspect untracked files; stash the SKILL.md -> STAGE.md rename work with a clearly named stash entry; confirm the stash contains only that user work and the repo is clean for Timeline edits.",
"depends_on": [],
"status": "done",
"executor_notes": "Starting state recorded: cwd /Users/user_c042661f/Documents/reigh-workspace/ArtAgents, branch main, HEAD d58b4fae819ab0676cb723e9bfc67c3d5f2b2b72. Initial dirty state was the broad SKILL.md -> STAGE.md rename work plus an untracked zero-byte .test_write. Created named stash phase2-timeline-protect-skill-stage-rename-work; verified it contains tracked rename/doc/test support changes only via git stash show --name-status stash@{1}. Created separate stash phase2-timeline-protect-untracked-test-write for .test_write; verified with . Final is clean: . No Timeline edits were made.",
"files_changed": [],
"commands_run": [
"git branch --show-current",
"git rev-parse HEAD",
"git status --short --branch",
"git status --porcelain=v1 -uall",
"git diff --stat",
"git diff --cached --stat",
"ls -l .test_write",
"git stash push -m "phase2-timeline-protect-skill-stage-rename-work"",
"git stash show --name-status stash@{1}",
"git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write",
"git stash show --include-untracked --name-status stash@{0}",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
{"output":"T2 complete. Baseline commands were run before code changes. CLI list checks passed. The roundtrip fixture baseline is not the planned xfail: it is currently 2 passed, 1 failed, with test_unknown_top_level_field_is_preserved failing because jsonschema.exceptions.ValidationError is raised before the test converts the rejection into the expected _XFailExpected xfail sentinel.","files_changed":[],"commands_run":["git status --short --branch","pytest tests/test_timeline_roundtrip_fixture.py -q","python3 -m artagents orchestrators list","python3 -m artagents executors list","sed -n '1,190p' tests/test_timeline_roundtrip_fixture.py","sed -n '190,280p' tests/test_timeline_roundtrip_fixture.py","ls -l .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_2.json","test -w .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_2.json; printf '%s\n' $?","git status --short --branch"],"deviations":["Best-effort checkpoint was not written because .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_2.json does not exist and is not writable.","Planned baseline said unknown top-level preservation should xfail, but actual baseline is a hard failure: pytest tests/test_timeline_roundtrip_fixture.py -q returned exit 1 with 1 failed, 2 passed."],"task_updates":[{"task_id":"T2","status":"done","executor_notes":"Pre-change worktree was clean on main. Ran pytest tests/test_timeline_roundtrip_fixture.py -q: result 1 failed, 2 passed. The byte-equivalent roundtrip and allowlist parity tests passed. TimelineRoundTripFixtureTest.test_unknown_top_level_field_is_preserved did not xfail as planned; it failed hard because shared-schema validation raised jsonschema.exceptions.ValidationError: Additional properties are not allowed ('_phase2_canary' was unexpected), which is outside the strict xfail marker's allowed raises=(_XFailExpected, AssertionError). Ran python3 -m artagents orchestrators list: passed and listed built-ins including builtin.hype. Ran python3 -m artagents executors list: passed and listed built-in/external executors including builtin.cut, builtin.render, builtin.validate, external.moirae, and external.vibecomfy.*. Final worktree remained clean.","files_changed":[],"commands_run":["git status --short --branch","pytest tests/test_timeline_roundtrip_fixture.py -q","python3 -m artagents orchestrators list","python3 -m artagents executors list"],"auto_attributed_files":false,"evidence_files":["tests/test_timeline_roundtrip_fixture.py"]}],"sense_check_acknowledgments":[{"sense_check_id":"SC2","executor_note":"Partially. The baseline fixture and CLI list commands establish current behavior, and both CLI list commands pass. However, the expected unknown-top-level preservation xfail is not currently an xfail: the fixture reports a hard failure because jsonschema.exceptions.ValidationError is raised before the test's _XFailExpected path."}]}
Phase 2: Introduce Timeline domain class in ArtAgents
Goal
Replace ad-hoc json.load/json.dump on hype.timeline.json across ArtAgents with a Timeline domain class that makes the current correctness discipline into a class invariant. This unblocks Phase 3 (collapsing source-cut and pure-generative pipelines into one).
Repo
/Users/user_c042661f/Documents/reigh-workspace/ArtAgents — currently on main at commit d58b4fa. Push directly to main (small project, this workflow is established).
User's working tree has uncommitted SKILL.md → STAGE.md rename work — must not be touched. Stash before working, restore after.
What just happened (context the planner needs)
Phase 1 just landed (commit 5cb7e81): deleted bin/ (30 wrappers), migrated pipeline subprocess to module form, deleted dead orchestrator-registry factories, cleaned docs. -430 LOC.
Prereq A landed (0524c5c on sprint-8-themed-render-via-orchestrator branch in /Users/user_c042661f/Documents/banodoco-workspace/packages/timeline-schema): output.background and output.background_scale now accept null in the shared @banodoco/timeline-schema package. Reigh + ArtAgents pick this up via symlink.
Prereq B landed (commit d58b4fa on ArtAgents main): tests/test_timeline_roundtrip_fixture.py with three assertions:
Byte-equivalent round-trip on examples/hype.timeline.full.json — passes today
Allowlist parity with shared schema — passes today
Unknown top-level field preservation — xfails today (Phase 2 should flip to xpass and the marker gets removed)
Design constraints from the Reigh compatibility analysis
The timeline shape is shared with the Reigh editor via @banodoco/timeline-schema. The Phase 2 design must respect:
Do NOT add clip.kind as a persisted field. Reigh's clip allowlist (reigh-app/src/tools/video-editor/lib/serialize.ts:8-42) is closed and throws on unknown clip keys. ArtAgents' _CLIP_ALLOWED matches it byte-equivalent. Any "kind" must be a runtime-derived view, not persisted.
.for_render() default-theme injection must be transient. Reigh routinely persists timelines without a theme and uses its own renderer-side fallback (reigh-app/.../renderRouter.ts:194-199). If ArtAgents writes back a defaulted theme, Reigh users see a silent theme switch on next load. Default-theme is a render-time view, never round-trips to disk.
The shared schema is the source of truth.artagents/timeline.py:30,858 already validates against the package's JSON Schema (_shared_validate_timeline). Phase 2 should keep using that, not maintain a separate Python allowlist.
Round-trip must remain byte-equivalent. The Prereq B fixture test is the regression gate.
What the Timeline class should be
Owns load/dump. Construction reads JSON, dump writes JSON.
Preserves unknown top-level fields by construction (the _phase2_canary xfail in Prereq B should flip to passing, and the xfail marker should be removed).
.for_render() returns a transient view with theme defaulted to a renderable value if missing. Never mutates self. Never round-trips.
Exposes typed access to known fields (.theme, .clips, .tracks, .theme_overrides, .generation_defaults, .pinnedShotGroups, .output).
Provides a runtime clip.classified_kind (or equivalent) computed from clipType + asset registry MIME — for internal dispatch only, never persisted. Should include an OPAQUE arm for unknown clipTypes (Reigh's clipType is intentionally open-string).
Direct json.load of hype.timeline.json becomes the wrong way to do it everywhere. The migration scope is roughly ~12 executors that touch timelines (cut, arrange, refine, render, validate, editor_review, human_notes, inspect_cut, plus anything in pipeline.py that reads/writes timeline JSON directly).
Find the actual scope by grepping for hype.timeline.json and load_timeline/save_timeline callers.
Success criteria
tests/test_timeline_roundtrip_fixture.py::test_unknown_top_level_field_is_preserved flips from xfail to xpass; the xfail marker is removed (now an unconditional pass).
The other two roundtrip-fixture tests still pass.
The full test suite passes (excluding the two pre-existing failures: tests/test_pool_schema.py and tests/test_cut_timeline_resume.py::test_resume_mode_render_smoke).
python3 -m artagents orchestrators list and python3 -m artagents executors list still work.
End-to-end: a hype pipeline --dry-run smoke completes without error.
Direct json.load of hype.timeline.json (or hype.assets/hype.metadata) is gone from the executor code paths — every read goes through the Timeline class. Grep is the test.
No new persisted fields in clips/tracks/timeline (allowlist parity test still passes).
.for_render()'s injected theme never appears in any saved JSON file (write a test for this).
Out of scope for Phase 2
Don't collapse the source-cut vs pure-generative pipelines (that's Phase 3, depends on this).
Don't change the schema package itself (handled in Prereq A, on the sprint branch).
Don't touch Pool / AssetRegistry — same pattern probably applies but defer until Timeline proves out.
Don't rewrite docs beyond what's needed for the migration (no SKILL.md expansion — user wants those terse).
Working notes
The Prereq B test file is the canary — re-run it after each meaningful step.
Commit messages should be focused; multiple commits over one mega-commit is fine for this size.
ArtAgents pyenv is 3.11.11. Pytest available via pytest shim. To run: pytest tests/ -q --ignore=tests/test_pool_schema.py --ignore=tests/test_cut_timeline_resume.py.
The python command in this shell requires PYENV_VERSION=3.11.11 python ..., but python3 works directly.
code
Batch framing:
- Execute batch 3 of 8.
- Actionable task IDs for this batch: ['T3']
- Already completed task IDs available as dependency context: ['T1', 'T2']
Actionable tasks for this batch:
[
{
"id": "T3",
"description": "Implement the Timeline domain class in artagents/timeline.py. It must own persisted JSON load/dump, preserve unknown top-level fields, keep clip/track validation strict, continue using the shared JSON Schema, allow persisted timelines with no theme, expose typed properties for known fields, centralize from_/from JSON boundary conversion, and keep load_timeline() / save_timeline() as compatibility shims backed by the class.",
"depends_on": [
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Protect the existing user work before editing: record branch, HEAD, and dirty state; inspect untracked files; stash the SKILL.md -> STAGE.md rename work with a clearly named stash entry; confirm the stash contains only that user work and the repo is clean for Timeline edits.",
"depends_on": [],
"status": "done",
"executor_notes": "Starting state recorded: cwd /Users/user_c042661f/Documents/reigh-workspace/ArtAgents, branch main, HEAD d58b4fae819ab0676cb723e9bfc67c3d5f2b2b72. Initial dirty state was the broad SKILL.md -> STAGE.md rename work plus an untracked zero-byte .test_write. Created named stash phase2-timeline-protect-skill-stage-rename-work; verified it contains tracked rename/doc/test support changes only via . Created separate stash for ; verified with . Final is clean: . No Timeline edits were made.",
"files_changed": [],
"commands_run": [
"git branch --show-current",
"git rev-parse HEAD",
"git status --short --branch",
"git status --porcelain=v1 -uall",
"git diff --stat",
"git diff --cached --stat",
"ls -l .test_write",
"git stash push -m "phase2-timeline-protect-skill-stage-rename-work"",
"git stash show --name-status stash@{1}",
"git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write",
"git stash show --include-untracked --name-status stash@{0}",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Run baseline checks before code changes: , , and . Record the expected xfail state for unknown top-level field preservation before changing it.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Pre-change worktree was clean on . Ran : result . The byte-equivalent roundtrip and allowlist parity tests passed. did not xfail as planned; it failed hard because shared-schema validation raised , which is outside the strict xfail marker's allowed . Ran : passed and listed built-ins including . Ran : passed and listed built-in/external executors including , , , , and . Final worktree remained clean.",
"files_changed": [],
"commands_run": [
"git status --short --branch",
"pytest tests/test_timeline_roundtrip_fixture.py -q",
"python3 -m artagents orchestrators list",
"python3 -m artagents executors list"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
{"output":"T3 complete. Implemented Timeline in artagents/timeline.py, kept load_timeline() / save_timeline() as compatibility shims backed by it, preserved unknown top-level fields, allowed missing persisted theme, and kept clip/track validation strict. Verification shows the roundtrip fixture now reaches XPASS(strict) for the unknown-top-level test, which is expected until T8 removes the xfail marker.","files_changed":["artagents/timeline.py"],"commands_run":["git status --short --branch","sed -n '1,220p' artagents/timeline.py","sed -n '220,520p' artagents/timeline.py","sed -n '520,940p' artagents/timeline.py","rg "load_timeline|save_timeline|Timeline" -n tests artagents | head -100","python3 -m py_compile artagents/timeline.py","pytest tests/test_timeline_roundtrip_fixture.py -q","python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.timeline import Timeline, load_timeline, save_timeline\n\nfixture = Path('examples/hype.timeline.full.json')\nbase = json.loads(fixture.read_text(encoding='utf-8'))\nwith tempfile.TemporaryDirectory() as tmp:\n tmp = Path(tmp)\n payload = dict(base)\n payload['_phase2_canary'] = 'preserve me'\n payload.pop('theme', None)\n in_path = tmp / 'timeline.json'\n out_path = tmp / 'out.json'\n in_path.write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')\n timeline = Timeline.load(in_path)\n assert timeline.theme is None\n assert timeline.clips\n timeline.dump(out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n config = load_timeline(in_path)\n save_timeline(config, out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n bad = dict(base)\n bad['clips'] = [dict(base['clips'][0], unexpected='nope')]\n bad_path = tmp / 'bad.json'\n bad_path.write_text(json.dumps(bad, indent=2) + '\n', encoding='utf-8')\n try:\n Timeline.load(bad_path)\n except Exception as exc:\n assert 'unexpected' in str(exc)\n else:\n raise AssertionError('unknown clip key was accepted')\nprint('timeline domain smoke passed')\nPY","git diff -- artagents/timeline.py","git status --short --branch","ls -l .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_3.json","test -w .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_3.json; printf '%s\n' $?"],"deviations":["Best-effort checkpoint was not written because .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_3.json does not exist and is not writable.","pytest tests/test_timeline_roundtrip_fixture.py -q now fails as XPASS(strict) for test_unknown_top_level_field_is_preserved; this is the expected intermediate state because T3 made the behavior pass while T8 owns removing the xfail marker."],"task_updates":[{"task_id":"T3","status":"done","executor_notes":"Implemented Timeline in artagents/timeline.py. Timeline.load() reads JSON and converts persisted from to in-memory from_; Timeline.dump() writes JSON and converts from_ back to from. load_timeline() and save_timeline() now delegate through the class while continuing to return/accept dict-compatible TimelineConfig values. Unknown top-level fields are preserved by construction, while shared-schema validation still runs against the known persisted Timeline subset and local clip/track validation remains closed. Missing persisted theme is now accepted; non-string/empty theme values still fail. Typed accessors were added for theme, clips, tracks, theme_overrides, generation_defaults, pinnedShotGroups, and output. Verification: python3 -m py_compile artagents/timeline.py passed. A focused Timeline smoke confirmed Timeline.load().dump() and compatibility shims preserve _phase2_canary, omit missing theme, and reject an unknown clip key. The full tests/test_timeline_roundtrip_fixture.py module now reports 2 passed, 1 failed only because the unknown-field test is a strict XPASS pending T8 marker removal.","files_changed":["artagents/timeline.py"],"commands_run":["python3 -m py_compile artagents/timeline.py","pytest tests/test_timeline_roundtrip_fixture.py -q","python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.timeline import Timeline, load_timeline, save_timeline\n\nfixture = Path('examples/hype.timeline.full.json')\nbase = json.loads(fixture.read_text(encoding='utf-8'))\nwith tempfile.TemporaryDirectory() as tmp:\n tmp = Path(tmp)\n payload = dict(base)\n payload['_phase2_canary'] = 'preserve me'\n payload.pop('theme', None)\n in_path = tmp / 'timeline.json'\n out_path = tmp / 'out.json'\n in_path.write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')\n timeline = Timeline.load(in_path)\n assert timeline.theme is None\n assert timeline.clips\n timeline.dump(out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n config = load_timeline(in_path)\n save_timeline(config, out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n bad = dict(base)\n bad['clips'] = [dict(base['clips'][0], unexpected='nope')]\n bad_path = tmp / 'bad.json'\n bad_path.write_text(json.dumps(bad, indent=2) + '\n', encoding='utf-8')\n try:\n Timeline.load(bad_path)\n except Exception as exc:\n assert 'unexpected' in str(exc)\n else:\n raise AssertionError('unknown clip key was accepted')\nprint('timeline domain smoke passed')\nPY","git diff -- artagents/timeline.py","git status --short --branch"],"auto_attributed_files":true,"evidence_files":["artagents/timeline.py","tests/test_timeline_roundtrip_fixture.py"]}],"sense_check_acknowledgments":[{"sense_check_id":"SC3","executor_note":"Yes. Timeline.load().dump() now preserves unknown top-level fields, accepts a missing persisted theme, keeps shared-schema validation for known Timeline fields, and still rejects unknown clip keys. _TIMELINE_TOP_ALLOWED, _CLIP_ALLOWED, and _TRACK_ALLOWED were not changed, so persisted allowlist parity is unchanged."}]}
Phase 2: Introduce Timeline domain class in ArtAgents
Goal
Replace ad-hoc json.load/json.dump on hype.timeline.json across ArtAgents with a Timeline domain class that makes the current correctness discipline into a class invariant. This unblocks Phase 3 (collapsing source-cut and pure-generative pipelines into one).
Repo
/Users/user_c042661f/Documents/reigh-workspace/ArtAgents — currently on main at commit d58b4fa. Push directly to main (small project, this workflow is established).
User's working tree has uncommitted SKILL.md → STAGE.md rename work — must not be touched. Stash before working, restore after.
What just happened (context the planner needs)
Phase 1 just landed (commit 5cb7e81): deleted bin/ (30 wrappers), migrated pipeline subprocess to module form, deleted dead orchestrator-registry factories, cleaned docs. -430 LOC.
Prereq A landed (0524c5c on sprint-8-themed-render-via-orchestrator branch in /Users/user_c042661f/Documents/banodoco-workspace/packages/timeline-schema): output.background and output.background_scale now accept null in the shared @banodoco/timeline-schema package. Reigh + ArtAgents pick this up via symlink.
Prereq B landed (commit d58b4fa on ArtAgents main): tests/test_timeline_roundtrip_fixture.py with three assertions:
Byte-equivalent round-trip on examples/hype.timeline.full.json — passes today
Allowlist parity with shared schema — passes today
Unknown top-level field preservation — xfails today (Phase 2 should flip to xpass and the marker gets removed)
Design constraints from the Reigh compatibility analysis
The timeline shape is shared with the Reigh editor via @banodoco/timeline-schema. The Phase 2 design must respect:
Do NOT add clip.kind as a persisted field. Reigh's clip allowlist (reigh-app/src/tools/video-editor/lib/serialize.ts:8-42) is closed and throws on unknown clip keys. ArtAgents' _CLIP_ALLOWED matches it byte-equivalent. Any "kind" must be a runtime-derived view, not persisted.
.for_render() default-theme injection must be transient. Reigh routinely persists timelines without a theme and uses its own renderer-side fallback (reigh-app/.../renderRouter.ts:194-199). If ArtAgents writes back a defaulted theme, Reigh users see a silent theme switch on next load. Default-theme is a render-time view, never round-trips to disk.
The shared schema is the source of truth.artagents/timeline.py:30,858 already validates against the package's JSON Schema (_shared_validate_timeline). Phase 2 should keep using that, not maintain a separate Python allowlist.
Round-trip must remain byte-equivalent. The Prereq B fixture test is the regression gate.
What the Timeline class should be
Owns load/dump. Construction reads JSON, dump writes JSON.
Preserves unknown top-level fields by construction (the _phase2_canary xfail in Prereq B should flip to passing, and the xfail marker should be removed).
.for_render() returns a transient view with theme defaulted to a renderable value if missing. Never mutates self. Never round-trips.
Exposes typed access to known fields (.theme, .clips, .tracks, .theme_overrides, .generation_defaults, .pinnedShotGroups, .output).
Provides a runtime clip.classified_kind (or equivalent) computed from clipType + asset registry MIME — for internal dispatch only, never persisted. Should include an OPAQUE arm for unknown clipTypes (Reigh's clipType is intentionally open-string).
Direct json.load of hype.timeline.json becomes the wrong way to do it everywhere. The migration scope is roughly ~12 executors that touch timelines (cut, arrange, refine, render, validate, editor_review, human_notes, inspect_cut, plus anything in pipeline.py that reads/writes timeline JSON directly).
Find the actual scope by grepping for hype.timeline.json and load_timeline/save_timeline callers.
Success criteria
tests/test_timeline_roundtrip_fixture.py::test_unknown_top_level_field_is_preserved flips from xfail to xpass; the xfail marker is removed (now an unconditional pass).
The other two roundtrip-fixture tests still pass.
The full test suite passes (excluding the two pre-existing failures: tests/test_pool_schema.py and tests/test_cut_timeline_resume.py::test_resume_mode_render_smoke).
python3 -m artagents orchestrators list and python3 -m artagents executors list still work.
End-to-end: a hype pipeline --dry-run smoke completes without error.
Direct json.load of hype.timeline.json (or hype.assets/hype.metadata) is gone from the executor code paths — every read goes through the Timeline class. Grep is the test.
No new persisted fields in clips/tracks/timeline (allowlist parity test still passes).
.for_render()'s injected theme never appears in any saved JSON file (write a test for this).
Out of scope for Phase 2
Don't collapse the source-cut vs pure-generative pipelines (that's Phase 3, depends on this).
Don't change the schema package itself (handled in Prereq A, on the sprint branch).
Don't touch Pool / AssetRegistry — same pattern probably applies but defer until Timeline proves out.
Don't rewrite docs beyond what's needed for the migration (no SKILL.md expansion — user wants those terse).
Working notes
The Prereq B test file is the canary — re-run it after each meaningful step.
Commit messages should be focused; multiple commits over one mega-commit is fine for this size.
ArtAgents pyenv is 3.11.11. Pytest available via pytest shim. To run: pytest tests/ -q --ignore=tests/test_pool_schema.py --ignore=tests/test_cut_timeline_resume.py.
The python command in this shell requires PYENV_VERSION=3.11.11 python ..., but python3 works directly.
code
Batch framing:
- Execute batch 4 of 8.
- Actionable task IDs for this batch: ['T4', 'T5']
- Already completed task IDs available as dependency context: ['T1', 'T2', 'T3']
Actionable tasks for this batch:
[
{
"id": "T4",
"description": "Add runtime-only clip classification to the Timeline API. Derive classified_kind from clipType plus asset registry MIME/type, include an OPAQUE arm for unknown open-string clip types, and ensure no derived kind or classification fields can appear in persisted clip JSON.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add the transient render view API. Timeline.for_render(default_theme=\"banodoco-default\") must return a render-ready view where missing theme resolves to the default, without mutating the source Timeline and without making that injected theme dumpable back to persisted JSON. Move render JSON serialization details currently duplicated in the render executor into the Timeline API where appropriate.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Protect the existing user work before editing: record branch, HEAD, and dirty state; inspect untracked files; stash the SKILL.md -> STAGE.md rename work with a clearly named stash entry; confirm the stash contains only that user work and the repo is clean for Timeline edits.",
"depends_on": [],
"status": "done",
"executor_notes": "Starting state recorded: cwd , branch , HEAD . Initial dirty state was the broad SKILL.md -> STAGE.md rename work plus an untracked zero-byte . Created named stash ; verified it contains tracked rename/doc/test support changes only via . Created separate stash for ; verified with . Final is clean: . No Timeline edits were made.",
"files_changed": [],
"commands_run": [
"git branch --show-current",
"git rev-parse HEAD",
"git status --short --branch",
"git status --porcelain=v1 -uall",
"git diff --stat",
"git diff --cached --stat",
"ls -l .test_write",
"git stash push -m "phase2-timeline-protect-skill-stage-rename-work"",
"git stash show --name-status stash@{1}",
"git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write",
"git stash show --include-untracked --name-status stash@{0}",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Run baseline checks before code changes: , , and . Record the expected xfail state for unknown top-level field preservation before changing it.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Pre-change worktree was clean on . Ran : result . The byte-equivalent roundtrip and allowlist parity tests passed. did not xfail as planned; it failed hard because shared-schema validation raised , which is outside the strict xfail marker's allowed . Ran : passed and listed built-ins including . Ran : passed and listed built-in/external executors including , , , , and . Final worktree remained clean.",
"files_changed": [],
"commands_run": [
"git status --short --branch",
"pytest tests/test_timeline_roundtrip_fixture.py -q",
"python3 -m artagents orchestrators list",
"python3 -m artagents executors list"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Implement the domain class in . It must own persisted JSON load/dump, preserve unknown top-level fields, keep clip/track validation strict, continue using the shared JSON Schema, allow persisted timelines with no , expose typed properties for known fields, centralize / JSON boundary conversion, and keep / as compatibility shims backed by the class.",
"depends_on": [
"T2"
],
"status": "done",
"executor_notes": "Implemented in . reads JSON and converts persisted to in-memory ; writes JSON and converts back to . and now delegate through the class while continuing to return/accept dict-compatible values. Unknown top-level fields are preserved by construction, while shared-schema validation still runs against the known persisted Timeline subset and local clip/track validation remains closed. Missing persisted is now accepted; non-string/empty theme values still fail. Typed accessors were added for , , , , , , and . Verification: passed. A focused Timeline smoke confirmed and compatibility shims preserve , omit missing , and reject an unknown clip key. The full module now reports only because the unknown-field test is a strict XPASS pending T8 marker removal.",
"files_changed": [
"artagents/timeline.py"
],
"commands_run": [
"python3 -m py_compile artagents/timeline.py",
"pytest tests/test_timeline_roundtrip_fixture.py -q",
"python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.timeline import Timeline, load_timeline, save_timeline\n\nfixture = Path('examples/hype.timeline.full.json')\nbase = json.loads(fixture.read_text(encoding='utf-8'))\nwith tempfile.TemporaryDirectory() as tmp:\n tmp = Path(tmp)\n payload = dict(base)\n payload['_phase2_canary'] = 'preserve me'\n payload.pop('theme', None)\n in_path = tmp / 'timeline.json'\n out_path = tmp / 'out.json'\n in_path.write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')\n timeline = Timeline.load(in_path)\n assert timeline.theme is None\n assert timeline.clips\n timeline.dump(out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n config = load_timeline(in_path)\n save_timeline(config, out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n bad = dict(base)\n bad['clips'] = [dict(base['clips'][0], unexpected='nope')]\n bad_path = tmp / 'bad.json'\n bad_path.write_text(json.dumps(bad, indent=2) + '\n', encoding='utf-8')\n try:\n Timeline.load(bad_path)\n except Exception as exc:\n assert 'unexpected' in str(exc)\n else:\n raise AssertionError('unknown clip key was accepted')\nprint('timeline domain smoke passed')\nPY",
"git diff -- artagents/timeline.py",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
{"output":"T4 and T5 complete. Added runtime-only clip classification and transient render views, and moved render executor timeline props serialization onto Timeline.for_render(). No derived classification fields are written to timeline JSON, and default theme injection remains render-only.","files_changed":["artagents/timeline.py","artagents/executors/render/run.py"],"commands_run":["sed -n '200,290p' artagents/executors/render/run.py","sed -n '290,380p' artagents/executors/render/run.py","rg "clipType|asset.*type|mime|classified|Timeline\.for_render|banodoco-default|theme" artagents tests -n","sed -n '630,760p' artagents/timeline.py","git status --short --branch","python3 -m py_compile artagents/timeline.py artagents/executors/render/run.py","pytest tests/test_render_remotion_registry.py -q","pytest tests/test_schema_contract.py -q","pytest tests/test_timeline_roundtrip_fixture.py -q","python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.timeline import ClipClassifiedKind, Timeline, validate_timeline\n\nbase = json.loads(Path('examples/hype.timeline.full.json').read_text(encoding='utf-8'))\nbase.pop('theme', None)\nbase['clips'] = [\n {'id': 'v', 'at': 0, 'track': 'v1', 'clipType': 'media', 'asset': 'video'},\n {'id': 'i', 'at': 1, 'track': 'v1', 'clipType': 'media', 'asset': 'image'},\n {'id': 'a', 'at': 2, 'track': 'a1', 'clipType': 'media', 'asset': 'audio'},\n {'id': 't', 'at': 3, 'track': 'v1', 'clipType': 'text'},\n {'id': 'u', 'at': 4, 'track': 'v1', 'clipType': 'future-reigh-clip'},\n]\nregistry = {\n 'assets': {\n 'video': {'file': '/tmp/v.mp4', 'type': 'video'},\n 'image': {'file': '/tmp/i.png', 'mimeType': 'image/png'},\n 'audio': {'file': '/tmp/a.wav', 'contentType': 'audio/wav'},\n }\n}\nvalidate_timeline(base)\ntimeline = Timeline.from_config(base)\nassert [view.classified_kind for view in timeline.classified_clips(registry)] == [\n ClipClassifiedKind.VIDEO,\n ClipClassifiedKind.IMAGE,\n ClipClassifiedKind.AUDIO,\n ClipClassifiedKind.TEXT,\n ClipClassifiedKind.OPAQUE,\n]\nrender_view = timeline.for_render()\nassert timeline.theme is None\nassert render_view.theme == 'banodoco-default'\nrender_json = render_view.to_json_data()\nassert render_json['theme'] == 'banodoco-default'\nfor clip in render_json['clips']:\n assert 'kind' not in clip\n assert 'classified_kind' not in clip\nwith tempfile.TemporaryDirectory() as tmp:\n out = Path(tmp) / 'timeline.json'\n timeline.dump(out)\n persisted = json.loads(out.read_text(encoding='utf-8'))\n assert 'theme' not in persisted\n for clip in persisted['clips']:\n assert 'kind' not in clip\n assert 'classified_kind' not in clip\nprint('classification and render view smoke passed')\nPY","python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.executors.render.run import _serialize_timeline\n\npayload = json.loads(Path('examples/hype.timeline.full.json').read_text(encoding='utf-8'))\npayload.pop('theme', None)\nwith tempfile.TemporaryDirectory() as tmp:\n path = Path(tmp) / 'timeline.json'\n path.write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')\n props_timeline = _serialize_timeline(path)\n persisted = json.loads(path.read_text(encoding='utf-8'))\n assert props_timeline['theme'] == 'banodoco-default'\n assert 'theme' not in persisted\nprint('render serialization smoke passed')\nPY","git diff --stat","git diff -- artagents/timeline.py artagents/executors/render/run.py","git status --short --branch","ls -l .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_4.json","test -w .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_4.json; printf '%s\n' $?"],"deviations":["Best-effort checkpoint was not written because .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_4.json does not exist and is not writable.","pytest tests/test_timeline_roundtrip_fixture.py -q still fails as XPASS(strict) for unknown top-level preservation; T8 owns removing the xfail marker.","pytest tests/test_schema_contract.py -q reports 2 failures: generated type byte stability and the old missing-theme rejection expectation. The missing-theme test is now intentionally obsolete after T3/T5; the generated type byte-stability failure needs handling in the later test-update/regeneration batch if it remains part of the suite."],"task_updates":[{"task_id":"T4","status":"done","executor_notes":"Added ClipClassifiedKind with VIDEO, IMAGE, AUDIO, TEXT, EFFECT, and OPAQUE arms plus TimelineClipView.classified_kind. Classification is derived at runtime from clipType and, for media/hold clips, registry entry type or MIME-style fields (mime, mimeType, contentType). Unknown open-string clipType values now validate and classify as OPAQUE instead of failing solely because the string is unfamiliar. A focused smoke verified media classification from registry type/MIME, text classification, unknown clipType -> OPAQUE, and no persisted kind or classified_kind fields in either render JSON clips or dumped timeline JSON.","files_changed":["artagents/timeline.py"],"commands_run":["python3 -m py_compile artagents/timeline.py artagents/executors/render/run.py","python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.timeline import ClipClassifiedKind, Timeline, validate_timeline\n\nbase = json.loads(Path('examples/hype.timeline.full.json').read_text(encoding='utf-8'))\nbase.pop('theme', None)\nbase['clips'] = [\n {'id': 'v', 'at': 0, 'track': 'v1', 'clipType': 'media', 'asset': 'video'},\n {'id': 'i', 'at': 1, 'track': 'v1', 'clipType': 'media', 'asset': 'image'},\n {'id': 'a', 'at': 2, 'track': 'a1', 'clipType': 'media', 'asset': 'audio'},\n {'id': 't', 'at': 3, 'track': 'v1', 'clipType': 'text'},\n {'id': 'u', 'at': 4, 'track': 'v1', 'clipType': 'future-reigh-clip'},\n]\nregistry = {\n 'assets': {\n 'video': {'file': '/tmp/v.mp4', 'type': 'video'},\n 'image': {'file': '/tmp/i.png', 'mimeType': 'image/png'},\n 'audio': {'file': '/tmp/a.wav', 'contentType': 'audio/wav'},\n }\n}\nvalidate_timeline(base)\ntimeline = Timeline.from_config(base)\nassert [view.classified_kind for view in timeline.classified_clips(registry)] == [\n ClipClassifiedKind.VIDEO,\n ClipClassifiedKind.IMAGE,\n ClipClassifiedKind.AUDIO,\n ClipClassifiedKind.TEXT,\n ClipClassifiedKind.OPAQUE,\n]\nrender_view = timeline.for_render()\nassert timeline.theme is None\nassert render_view.theme == 'banodoco-default'\nrender_json = render_view.to_json_data()\nassert render_json['theme'] == 'banodoco-default'\nfor clip in render_json['clips']:\n assert 'kind' not in clip\n assert 'classified_kind' not in clip\nwith tempfile.TemporaryDirectory() as tmp:\n out = Path(tmp) / 'timeline.json'\n timeline.dump(out)\n persisted = json.loads(out.read_text(encoding='utf-8'))\n assert 'theme' not in persisted\n for clip in persisted['clips']:\n assert 'kind' not in clip\n assert 'classified_kind' not in clip\nprint('classification and render view smoke passed')\nPY","pytest tests/test_schema_contract.py -q"],"auto_attributed_files":true,"evidence_files":["artagents/timeline.py"]},{"task_id":"T5","status":"done","executor_notes":"Added TimelineRenderView and Timeline.for_render(default_theme=\"banodoco-default\"). The render view exposes a renderable theme when the persisted timeline omits theme, returns render JSON with the default theme injected, and does not mutate or dump that default through Timeline.dump(). Updated artagents/executors/render/run.py so _serialize_timeline() uses Timeline.load(...).for_render(...).to_json_data() instead of duplicating from_/from serialization, and _resolved_theme_for_render() uses a transient timeline config with the render default only for theme resolution. Verification: py_compile passed, pytest tests/test_render_remotion_registry.py -q passed, and a render serialization smoke proved missing-theme props get banodoco-default while the source JSON remains without theme.","files_changed":["artagents/timeline.py","artagents/executors/render/run.py"],"commands_run":["python3 -m py_compile artagents/timeline.py artagents/executors/render/run.py","pytest tests/test_render_remotion_registry.py -q","python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.executors.render.run import _serialize_timeline\n\npayload = json.loads(Path('examples/hype.timeline.full.json').read_text(encoding='utf-8'))\npayload.pop('theme', None)\nwith tempfile.TemporaryDirectory() as tmp:\n path = Path(tmp) / 'timeline.json'\n path.write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')\n props_timeline = _serialize_timeline(path)\n persisted = json.loads(path.read_text(encoding='utf-8'))\n assert props_timeline['theme'] == 'banodoco-default'\n assert 'theme' not in persisted\nprint('render serialization smoke passed')\nPY","pytest tests/test_timeline_roundtrip_fixture.py -q"],"auto_attributed_files":true,"evidence_files":["artagents/timeline.py","artagents/executors/render/run.py","tests/test_render_remotion_registry.py"]}],"sense_check_acknowledgments":[{"sense_check_id":"SC4","executor_note":"Yes. Classification is runtime-only via TimelineClipView.classified_kind, derived from clipType and registry type/MIME data. Unknown open-string clipType values classify as OPAQUE. Smoke verification confirmed neither kind nor classified_kind appears in render JSON clips or persisted timeline JSON."},{"sense_check_id":"SC5","executor_note":"Yes. .for_render() exposes banodoco-default when theme is missing, leaves the source Timeline.theme as None, and Timeline.dump() still omits the injected theme. Render executor props serialization now uses the transient render view."}]}
Phase 2: Introduce Timeline domain class in ArtAgents
Goal
Replace ad-hoc json.load/json.dump on hype.timeline.json across ArtAgents with a Timeline domain class that makes the current correctness discipline into a class invariant. This unblocks Phase 3 (collapsing source-cut and pure-generative pipelines into one).
Repo
/Users/user_c042661f/Documents/reigh-workspace/ArtAgents — currently on main at commit d58b4fa. Push directly to main (small project, this workflow is established).
User's working tree has uncommitted SKILL.md → STAGE.md rename work — must not be touched. Stash before working, restore after.
What just happened (context the planner needs)
Phase 1 just landed (commit 5cb7e81): deleted bin/ (30 wrappers), migrated pipeline subprocess to module form, deleted dead orchestrator-registry factories, cleaned docs. -430 LOC.
Prereq A landed (0524c5c on sprint-8-themed-render-via-orchestrator branch in /Users/user_c042661f/Documents/banodoco-workspace/packages/timeline-schema): output.background and output.background_scale now accept null in the shared @banodoco/timeline-schema package. Reigh + ArtAgents pick this up via symlink.
Prereq B landed (commit d58b4fa on ArtAgents main): tests/test_timeline_roundtrip_fixture.py with three assertions:
Byte-equivalent round-trip on examples/hype.timeline.full.json — passes today
Allowlist parity with shared schema — passes today
Unknown top-level field preservation — xfails today (Phase 2 should flip to xpass and the marker gets removed)
Design constraints from the Reigh compatibility analysis
The timeline shape is shared with the Reigh editor via @banodoco/timeline-schema. The Phase 2 design must respect:
Do NOT add clip.kind as a persisted field. Reigh's clip allowlist (reigh-app/src/tools/video-editor/lib/serialize.ts:8-42) is closed and throws on unknown clip keys. ArtAgents' _CLIP_ALLOWED matches it byte-equivalent. Any "kind" must be a runtime-derived view, not persisted.
.for_render() default-theme injection must be transient. Reigh routinely persists timelines without a theme and uses its own renderer-side fallback (reigh-app/.../renderRouter.ts:194-199). If ArtAgents writes back a defaulted theme, Reigh users see a silent theme switch on next load. Default-theme is a render-time view, never round-trips to disk.
The shared schema is the source of truth.artagents/timeline.py:30,858 already validates against the package's JSON Schema (_shared_validate_timeline). Phase 2 should keep using that, not maintain a separate Python allowlist.
Round-trip must remain byte-equivalent. The Prereq B fixture test is the regression gate.
What the Timeline class should be
Owns load/dump. Construction reads JSON, dump writes JSON.
Preserves unknown top-level fields by construction (the _phase2_canary xfail in Prereq B should flip to passing, and the xfail marker should be removed).
.for_render() returns a transient view with theme defaulted to a renderable value if missing. Never mutates self. Never round-trips.
Exposes typed access to known fields (.theme, .clips, .tracks, .theme_overrides, .generation_defaults, .pinnedShotGroups, .output).
Provides a runtime clip.classified_kind (or equivalent) computed from clipType + asset registry MIME — for internal dispatch only, never persisted. Should include an OPAQUE arm for unknown clipTypes (Reigh's clipType is intentionally open-string).
Direct json.load of hype.timeline.json becomes the wrong way to do it everywhere. The migration scope is roughly ~12 executors that touch timelines (cut, arrange, refine, render, validate, editor_review, human_notes, inspect_cut, plus anything in pipeline.py that reads/writes timeline JSON directly).
Find the actual scope by grepping for hype.timeline.json and load_timeline/save_timeline callers.
Success criteria
tests/test_timeline_roundtrip_fixture.py::test_unknown_top_level_field_is_preserved flips from xfail to xpass; the xfail marker is removed (now an unconditional pass).
The other two roundtrip-fixture tests still pass.
The full test suite passes (excluding the two pre-existing failures: tests/test_pool_schema.py and tests/test_cut_timeline_resume.py::test_resume_mode_render_smoke).
python3 -m artagents orchestrators list and python3 -m artagents executors list still work.
End-to-end: a hype pipeline --dry-run smoke completes without error.
Direct json.load of hype.timeline.json (or hype.assets/hype.metadata) is gone from the executor code paths — every read goes through the Timeline class. Grep is the test.
No new persisted fields in clips/tracks/timeline (allowlist parity test still passes).
.for_render()'s injected theme never appears in any saved JSON file (write a test for this).
Out of scope for Phase 2
Don't collapse the source-cut vs pure-generative pipelines (that's Phase 3, depends on this).
Don't change the schema package itself (handled in Prereq A, on the sprint branch).
Don't touch Pool / AssetRegistry — same pattern probably applies but defer until Timeline proves out.
Don't rewrite docs beyond what's needed for the migration (no SKILL.md expansion — user wants those terse).
Working notes
The Prereq B test file is the canary — re-run it after each meaningful step.
Commit messages should be focused; multiple commits over one mega-commit is fine for this size.
ArtAgents pyenv is 3.11.11. Pytest available via pytest shim. To run: pytest tests/ -q --ignore=tests/test_pool_schema.py --ignore=tests/test_cut_timeline_resume.py.
The python command in this shell requires PYENV_VERSION=3.11.11 python ..., but python3 works directly.
code
Batch framing:
- Execute batch 5 of 8.
- Actionable task IDs for this batch: ['T6']
- Already completed task IDs available as dependency context: ['T1', 'T2', 'T3', 'T4', 'T5']
Actionable tasks for this batch:
[
{
"id": "T6",
"description": "Migrate executor and pipeline consumers of hype.timeline.json to the Timeline API or its compatibility shims. Cover the actual grep-discovered scope, including validate, refine, render, cut, publish, enriched arrangement, and pipeline reads/writes where applicable, while preserving existing behavior and byte-equivalent serialization.",
"depends_on": [
"T3",
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Protect the existing user work before editing: record branch, HEAD, and dirty state; inspect untracked files; stash the SKILL.md -> STAGE.md rename work with a clearly named stash entry; confirm the stash contains only that user work and the repo is clean for Timeline edits.",
"depends_on": [],
"status": "done",
"executor_notes": "Starting state recorded: cwd /Users/user_c042661f/Documents/reigh-workspace/ArtAgents, branch main, HEAD d58b4fae819ab0676cb723e9bfc67c3d5f2b2b72. Initial dirty state was the broad SKILL.md -> STAGE.md rename work plus an untracked zero-byte .test_write. Created named stash phase2-timeline-protect-skill-stage-rename-work; verified it contains tracked rename/doc/test support changes only via git stash show --name-status stash@{1}. Created separate stash phase2-timeline-protect-untracked-test-write for ; verified with . Final is clean: . No Timeline edits were made.",
"files_changed": [],
"commands_run": [
"git branch --show-current",
"git rev-parse HEAD",
"git status --short --branch",
"git status --porcelain=v1 -uall",
"git diff --stat",
"git diff --cached --stat",
"ls -l .test_write",
"git stash push -m "phase2-timeline-protect-skill-stage-rename-work"",
"git stash show --name-status stash@{1}",
"git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write",
"git stash show --include-untracked --name-status stash@{0}",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Run baseline checks before code changes: , , and . Record the expected xfail state for unknown top-level field preservation before changing it.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Pre-change worktree was clean on . Ran : result . The byte-equivalent roundtrip and allowlist parity tests passed. did not xfail as planned; it failed hard because shared-schema validation raised , which is outside the strict xfail marker's allowed . Ran : passed and listed built-ins including . Ran : passed and listed built-in/external executors including , , , , and . Final worktree remained clean.",
"files_changed": [],
"commands_run": [
"git status --short --branch",
"pytest tests/test_timeline_roundtrip_fixture.py -q",
"python3 -m artagents orchestrators list",
"python3 -m artagents executors list"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Implement the domain class in . It must own persisted JSON load/dump, preserve unknown top-level fields, keep clip/track validation strict, continue using the shared JSON Schema, allow persisted timelines with no , expose typed properties for known fields, centralize / JSON boundary conversion, and keep / as compatibility shims backed by the class.",
"depends_on": [
"T2"
],
"status": "done",
"executor_notes": "Implemented in . reads JSON and converts persisted to in-memory ; writes JSON and converts back to . and now delegate through the class while continuing to return/accept dict-compatible values. Unknown top-level fields are preserved by construction, while shared-schema validation still runs against the known persisted Timeline subset and local clip/track validation remains closed. Missing persisted is now accepted; non-string/empty theme values still fail. Typed accessors were added for , , , , , , and . Verification: passed. A focused Timeline smoke confirmed and compatibility shims preserve , omit missing , and reject an unknown clip key. The full module now reports only because the unknown-field test is a strict XPASS pending T8 marker removal.",
"files_changed": [
"artagents/timeline.py"
],
"commands_run": [
"python3 -m py_compile artagents/timeline.py",
"pytest tests/test_timeline_roundtrip_fixture.py -q",
"python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.timeline import Timeline, load_timeline, save_timeline\n\nfixture = Path('examples/hype.timeline.full.json')\nbase = json.loads(fixture.read_text(encoding='utf-8'))\nwith tempfile.TemporaryDirectory() as tmp:\n tmp = Path(tmp)\n payload = dict(base)\n payload['_phase2_canary'] = 'preserve me'\n payload.pop('theme', None)\n in_path = tmp / 'timeline.json'\n out_path = tmp / 'out.json'\n in_path.write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')\n timeline = Timeline.load(in_path)\n assert timeline.theme is None\n assert timeline.clips\n timeline.dump(out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n config = load_timeline(in_path)\n save_timeline(config, out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n bad = dict(base)\n bad['clips'] = [dict(base['clips'][0], unexpected='nope')]\n bad_path = tmp / 'bad.json'\n bad_path.write_text(json.dumps(bad, indent=2) + '\n', encoding='utf-8')\n try:\n Timeline.load(bad_path)\n except Exception as exc:\n assert 'unexpected' in str(exc)\n else:\n raise AssertionError('unknown clip key was accepted')\nprint('timeline domain smoke passed')\nPY",
"git diff -- artagents/timeline.py",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Add runtime-only clip classification to the Timeline API. Derive from plus asset registry MIME/type, include an arm for unknown open-string clip types, and ensure no derived or classification fields can appear in persisted clip JSON.",
"depends_on": [
"T3"
],
"status": "done",
"executor_notes": "Added with , , , , , and arms plus . Classification is derived at runtime from and, for media/hold clips, registry entry or MIME-style fields (, , ). Unknown open-string values now validate and classify as instead of failing solely because the string is unfamiliar. A focused smoke verified media classification from registry type/MIME, text classification, unknown clipType -> , and no persisted or fields in either render JSON clips or dumped timeline JSON.",
"files_changed": [
"artagents/timeline.py"
],
"commands_run": [
"python3 -m py_compile artagents/timeline.py artagents/executors/render/run.py",
"python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.timeline import ClipClassifiedKind, Timeline, validate_timeline\n\nbase = json.loads(Path('examples/hype.timeline.full.json').read_text(encoding='utf-8'))\nbase.pop('theme', None)\nbase['clips'] = [\n {'id': 'v', 'at': 0, 'track': 'v1', 'clipType': 'media', 'asset': 'video'},\n {'id': 'i', 'at': 1, 'track': 'v1', 'clipType': 'media', 'asset': 'image'},\n {'id': 'a', 'at': 2, 'track': 'a1', 'clipType': 'media', 'asset': 'audio'},\n {'id': 't', 'at': 3, 'track': 'v1', 'clipType': 'text'},\n {'id': 'u', 'at': 4, 'track': 'v1', 'clipType': 'future-reigh-clip'},\n]\nregistry = {\n 'assets': {\n 'video': {'file': '/tmp/v.mp4', 'type': 'video'},\n 'image': {'file': '/tmp/i.png', 'mimeType': 'image/png'},\n 'audio': {'file': '/tmp/a.wav', 'contentType': 'audio/wav'},\n }\n}\nvalidate_timeline(base)\ntimeline = Timeline.from_config(base)\nassert [view.classified_kind for view in timeline.classified_clips(registry)] == [\n ClipClassifiedKind.VIDEO,\n ClipClassifiedKind.IMAGE,\n ClipClassifiedKind.AUDIO,\n ClipClassifiedKind.TEXT,\n ClipClassifiedKind.OPAQUE,\n]\nrender_view = timeline.for_render()\nassert timeline.theme is None\nassert render_view.theme == 'banodoco-default'\nrender_json = render_view.to_json_data()\nassert render_json['theme'] == 'banodoco-default'\nfor clip in render_json['clips']:\n assert 'kind' not in clip\n assert 'classified_kind' not in clip\nwith tempfile.TemporaryDirectory() as tmp:\n out = Path(tmp) / 'timeline.json'\n timeline.dump(out)\n persisted = json.loads(out.read_text(encoding='utf-8'))\n assert 'theme' not in persisted\n for clip in persisted['clips']:\n assert 'kind' not in clip\n assert 'classified_kind' not in clip\nprint('classification and render view smoke passed')\nPY",
"pytest tests/test_schema_contract.py -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add the transient render view API. must return a render-ready view where missing theme resolves to the default, without mutating the source Timeline and without making that injected theme dumpable back to persisted JSON. Move render JSON serialization details currently duplicated in the render executor into the Timeline API where appropriate.",
"depends_on": [
"T3"
],
"status": "done",
"executor_notes": "Added and . The render view exposes a renderable theme when the persisted timeline omits , returns render JSON with the default theme injected, and does not mutate or dump that default through . Updated so uses instead of duplicating / serialization, and uses a transient timeline config with the render default only for theme resolution. Verification: py_compile passed, passed, and a render serialization smoke proved missing-theme props get while the source JSON remains without .",
"files_changed": [
"artagents/timeline.py",
"artagents/executors/render/run.py"
],
"commands_run": [
"python3 -m py_compile artagents/timeline.py artagents/executors/render/run.py",
"pytest tests/test_render_remotion_registry.py -q",
"python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.executors.render.run import _serialize_timeline\n\npayload = json.loads(Path('examples/hype.timeline.full.json').read_text(encoding='utf-8'))\npayload.pop('theme', None)\nwith tempfile.TemporaryDirectory() as tmp:\n path = Path(tmp) / 'timeline.json'\n path.write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')\n props_timeline = _serialize_timeline(path)\n persisted = json.loads(path.read_text(encoding='utf-8'))\n assert props_timeline['theme'] == 'banodoco-default'\n assert 'theme' not in persisted\nprint('render serialization smoke passed')\nPY",
"pytest tests/test_timeline_roundtrip_fixture.py -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
Not yet included in a published release.
git stash show --include-untracked --name-status stash@{0}
git status --short --branch
## main...origin/main
code
Prior batch deviations (address if applicable):
[
"Best-effort checkpoint was not written because .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_1.json does not exist and is not writable.",
"Advisory observation mismatch: git status/content hash delta found unclaimed files: .test_write, AGENTS.md, README.md, SKILL.md, artagents/executors/arrange/SKILL.md, artagents/executors/arrange/STAGE.md, artagents/executors/asset_cache/SKILL.md, artagents/executors/asset_cache/STAGE.md, artagents/executors/audio_understand/SKILL.md, artagents/executors/audio_understand/STAGE.md, artagents/executors/boundary_candidates/SKILL.md, artagents/executors/boundary_candidates/STAGE.md, artagents/executors/cut/SKILL.md, artagents/executors/cut/STAGE.md, artagents/executors/editor_review/SKILL.md, artagents/executors/editor_review/STAGE.md, artagents/executors/folder.py, artagents/executors/generate_image/SKILL.md, artagents/executors/generate_image/STAGE.md, artagents/executors/human_notes/SKILL.md, artagents/executors/human_notes/STAGE.md, artagents/executors/inspect_cut/SKILL.md, artagents/executors/inspect_cut/STAGE.md, artagents/executors/moirae/SKILL.md, artagents/executors/moirae/STAGE.md, artagents/executors/open_in_reigh/SKILL.md, artagents/executors/open_in_reigh/STAGE.md, artagents/executors/pool_build/SKILL.md, artagents/executors/pool_build/STAGE.md, artagents/executors/pool_merge/SKILL.md, artagents/executors/pool_merge/STAGE.md, artagents/executors/publish/SKILL.md, artagents/executors/publish/STAGE.md, artagents/executors/quality_zones/SKILL.md, artagents/executors/quality_zones/STAGE.md, artagents/executors/quote_scout/SKILL.md, artagents/executors/quote_scout/STAGE.md, artagents/executors/refine/SKILL.md, artagents/executors/refine/STAGE.md, artagents/executors/reigh_data/SKILL.md, artagents/executors/reigh_data/STAGE.md, artagents/executors/render/SKILL.md, artagents/executors/render/STAGE.md, artagents/executors/scene_describe/SKILL.md, artagents/executors/scene_describe/STAGE.md, artagents/executors/scenes/SKILL.md, artagents/executors/scenes/STAGE.md, artagents/executors/shots/SKILL.md, artagents/executors/shots/STAGE.md, artagents/executors/sprite_sheet/SKILL.md, artagents/executors/sprite_sheet/STAGE.md, artagents/executors/transcribe/SKILL.md, artagents/executors/transcribe/STAGE.md, artagents/executors/triage/SKILL.md, artagents/executors/triage/STAGE.md, artagents/executors/upload_youtube/SKILL.md, artagents/executors/upload_youtube/STAGE.md, artagents/executors/validate/SKILL.md, artagents/executors/validate/STAGE.md, artagents/executors/vibecomfy/SKILL.md, artagents/executors/vibecomfy/STAGE.md, artagents/executors/video_understand/SKILL.md, artagents/executors/video_understand/STAGE.md, artagents/executors/visual_understand/SKILL.md, artagents/executors/visual_understand/STAGE.md, artagents/orchestrators/event_talks/SKILL.md, artagents/orchestrators/event_talks/STAGE.md, artagents/orchestrators/first_rite/SKILL.md, artagents/orchestrators/first_rite/STAGE.md, artagents/orchestrators/folder.py, artagents/orchestrators/hype/SKILL.md, artagents/orchestrators/hype/STAGE.md, artagents/orchestrators/thumbnail_maker/SKILL.md, artagents/orchestrators/thumbnail_maker/STAGE.md, artagents/orchestrators/understand/SKILL.md, artagents/orchestrators/understand/STAGE.md, artagents/setup_cli.py, artagents/structure.py, docs/architecture.md, docs/creating-tools.md, docs/templates/executor/SKILL.md, docs/templates/executor/STAGE.md, docs/templates/orchestrator/SKILL.md, docs/templates/orchestrator/STAGE.md, tests/test_default_registry_scopes.py, tests/test_onboarding_docs.py, tests/test_vibecomfy_metadata.py",
"Advisory: done tasks rely on commands_run without files_changed (FLAG-006 softening): T1",
"Advisory audit finding: Sense check SC2 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC3 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC4 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC5 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC6 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC7 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC8 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC9 is missing an executor acknowledgment."
]
code
User action prerequisites:
No user_action prerequisites for this batch.
Batch-scoped sense checks:
[
{
"id": "SC2",
"task_id": "T2",
"question": "Do the baseline roundtrip fixture and CLI list commands establish the current behavior, including the expected unknown-top-level preservation xfail before Phase 2 edits?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Protect the existing user work before editing: record branch, HEAD, and dirty state; inspect untracked files; stash the SKILL.md -> STAGE.md rename work with a clearly named stash entry; confirm the stash contains only that user work and the repo is clean for Timeline edits.",
"depends_on": [],
"status": "done",
"executor_notes": "Starting state recorded: cwd /Users/user_c042661f/Documents/reigh-workspace/ArtAgents, branch main, HEAD d58b4fae819ab0676cb723e9bfc67c3d5f2b2b72. Initial dirty state was the broad SKILL.md -> STAGE.md rename work plus an untracked zero-byte .test_write. Created named stash phase2-timeline-protect-skill-stage-rename-work; verified it contains tracked rename/doc/test support changes only via git stash show --name-status stash@{1}. Created separate stash phase2-timeline-protect-untracked-test-write for .test_write; verified with git stash show --include-untracked --name-status stash@{0}. Final git status --short --branch is clean: ## main...origin/main. No Timeline edits were made.",
"files_changed": [],
"commands_run": [
"git branch --show-current",
"git rev-parse HEAD",
"git status --short --branch",
"git status --porcelain=v1 -uall",
"git diff --stat",
"git diff --cached --stat",
"ls -l .test_write",
"git stash push -m "phase2-timeline-protect-skill-stage-rename-work"",
"git stash show --name-status stash@{1}",
"git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write",
"git stash show --include-untracked --name-status stash@{0}",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Run baseline checks before code changes: pytest tests/test_timeline_roundtrip_fixture.py -q, python3 -m artagents orchestrators list, and python3 -m artagents executors list. Record the expected xfail state for unknown top-level field preservation before changing it.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Implement the Timeline domain class in artagents/timeline.py. It must own persisted JSON load/dump, preserve unknown top-level fields, keep clip/track validation strict, continue using the shared JSON Schema, allow persisted timelines with no theme, expose typed properties for known fields, centralize from_/from JSON boundary conversion, and keep load_timeline() / save_timeline() as compatibility shims backed by the class.",
"depends_on": [
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Add runtime-only clip classification to the Timeline API. Derive classified_kind from clipType plus asset registry MIME/type, include an OPAQUE arm for unknown open-string clip types, and ensure no derived kind or classification fields can appear in persisted clip JSON.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add the transient render view API. Timeline.for_render(default_theme=\"banodoco-default\") must return a render-ready view where missing theme resolves to the default, without mutating the source Timeline and without making that injected theme dumpable back to persisted JSON. Move render JSON serialization details currently duplicated in the render executor into the Timeline API where appropriate.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T6",
"description": "Migrate executor and pipeline consumers of hype.timeline.json to the Timeline API or its compatibility shims. Cover the actual grep-discovered scope, including validate, refine, render, cut, publish, enriched arrangement, and pipeline reads/writes where applicable, while preserving existing behavior and byte-equivalent serialization.",
"depends_on": [
"T3",
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T7",
"description": "Migrate direct executor reads of paired Hype artifacts included in the grep gate: replace raw reads of hype.assets.json with artagents.timeline.load_registry(...) where validation is appropriate, and raw reads of hype.metadata.json with artagents.timeline.load_metadata(...). Do not broaden this into Pool, arrangement, transcript, scene, source media, or docs work.",
"depends_on": [
"T6"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T8",
"description": "Update tests for Phase 2 behavior. Remove the xfail marker from test_unknown_top_level_field_is_preserved; add or adjust focused tests proving unknown top-level preservation through Timeline and compatibility shims, missing-theme load/dump without persisted default injection, .for_render() transient theme behavior, and runtime-only clip classification with opaque unknown clip types. Keep allowlist parity unchanged.",
"depends_on": [
"T3",
"T4",
"T5",
"T6",
"T7"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T9",
"description": "Run final verification, fix failures, commit, push, and restore user work. Required checks: pytest tests/test_timeline_roundtrip_fixture.py -q; relevant focused executor tests after inspecting changed files; grep gate proving executor code no longer directly JSON-loads hype.timeline.json, hype.assets.json, or hype.metadata.json; broad suite using the documented exclusions but deselect only tests/test_cut_timeline_resume.py::CutTimelineResumeTest::test_resume_mode_render_smoke instead of ignoring the whole file if possible; python3 -m artagents orchestrators list; python3 -m artagents executors list; and a builtin.hype dry-run smoke after checking current syntax in artagents/orchestrators/hype/STAGE.md. Also write a short throwaway script under an ignored temp location that reproduces the missing-theme/unknown-top-level round-trip bug, run it to confirm the fix, then delete it. Commit focused changes, push directly to main, apply the saved user stash, and confirm the original SKILL/STAGE rename work is back in the working tree.",
"depends_on": [
"T8"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
],
"watch_items": [
"Do not invoke the megaplan CLI, read the megaplan skill, or start nested planning harnesses.",
"Start from /Users/user_c042661f/Documents/reigh-workspace/ArtAgents on main; push directly to main only after validation.",
"User SKILL.md -> STAGE.md rename work is unrelated and must be stashed before edits, untouched during implementation, and restored after pushing.",
"Do not infer read-only state. Attempt required edits and only report write failure after a concrete OS-level rejection and retry.",
"Do not persist clip.kind or any derived classification field. Reigh has a closed clip key allowlist and will reject unknown persisted keys.",
"Default theme injection is render-time only. .for_render() may expose a theme, but saved Timeline JSON must not gain a defaulted theme field.",
"Shared @banodoco/timeline-schema remains the schema source of truth. Avoid maintaining a new Python top-level allowlist for persisted Timeline fields.",
"Unknown top-level Timeline fields must be preserved, while clip and track unknown-key checks remain strict.",
"clipType is open-string; unknown values should classify as opaque rather than fail purely because the string is unfamiliar.",
"FLAG-003 remains open: avoid hiding regressions by ignoring all of tests/test_cut_timeline_resume.py; deselect only the documented pre-existing smoke failure if the test runner supports it.",
"Do not migrate Pool, AssetRegistry internals, arrangement, transcript, scene, source media, or broad docs beyond the named Hype artifact gate.",
"Round-trip byte equivalence for examples/hype.timeline.full.json is a hard regression gate.",
"Grep success criterion covers executor code paths for direct JSON reads of hype.timeline.json, hype.assets.json, and hype.metadata.json, not every unrelated JSON helper in the repo."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Was the pre-existing SKILL/STAGE rename work captured in a named stash, with branch/HEAD/dirty state recorded and no unrelated Timeline edits made before the stash?",
"executor_note": "Yes. The pre-existing SKILL/STAGE rename work was captured before Timeline edits in named stash phase2-timeline-protect-skill-stage-rename-work; branch/HEAD/dirty state were recorded; the only untracked file was inspected and separately stashed; final worktree is clean.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Do the baseline roundtrip fixture and CLI list commands establish the current behavior, including the expected unknown-top-level preservation xfail before Phase 2 edits?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does Timeline.load().dump() preserve unknown top-level fields, allow a missing persisted theme, keep shared-schema validation, and keep clip/track validation closed without changing persisted field allowlists?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Is clip classification derived only at runtime from clipType and registry MIME/type, with unknown clip types mapped to OPAQUE and no kind field written to JSON?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does .for_render() expose a renderable default theme when needed while leaving the original Timeline unchanged and unable to dump the injected theme?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Have all grep-discovered hype.timeline.json executor/pipeline reads and writes been routed through Timeline, load_timeline(), or save_timeline() without changing byte-equivalent output?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC7",
"task_id": "T7",
"question": "Are direct executor reads of hype.assets.json and hype.metadata.json migrated to typed loaders, with unrelated JSON artifacts left alone?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC8",
"task_id": "T8",
"question": "Do tests now assert unconditional unknown-top-level preservation, missing-theme persistence, transient render theme behavior, runtime-only classification, and unchanged allowlist parity?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC9",
"task_id": "T9",
"question": "Do the targeted tests, grep gate, broad suite with only documented exclusions, CLI smokes, hype dry-run smoke, and throwaway reproduction script all pass before commit/push, and is the user stash restored afterward?",
"executor_note": "",
"verdict": ""
}
],
"user_actions": [],
"meta_commentary": "Execution should proceed in a tight loop: protect user work first, prove the current baseline, implement Timeline invariants, then migrate consumers only as far as the named Hype artifact gate requires. The key design judgment is to separate persisted compatibility from render readiness: persisted timelines may omit theme and carry unknown top-level keys, while render views can inject defaults transiently. Keep JSON boundary mechanics in artagents/timeline.py; executor changes should become simpler, not grow new local serializers. Treat FLAG-003 as a validation refinement: the known bad smoke test can be deselected, but the rest of tests/test_cut_timeline_resume.py is relevant to this phase and should run if feasible.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Protect user work and establish baseline",
"finalize_item_ids": [
"T1",
"T2"
]
},
{
"plan_step_summary": "Step 2: Add Timeline with persisted-vs-render validation",
"finalize_item_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 3: Add runtime clip classification",
"finalize_item_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 4: Implement transient render view and update render executor serialization",
"finalize_item_ids": [
"T5",
"T6"
]
},
{
"plan_step_summary": "Step 5: Migrate Hype artifact consumers in executor paths",
"finalize_item_ids": [
"T6",
"T7"
]
},
{
"plan_step_summary": "Step 6: Update tests for Phase 2 behavior",
"finalize_item_ids": [
"T8"
]
},
{
"plan_step_summary": "Step 7: Validate broadly and commit",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Execution order 1: Stash user work before touching files",
"finalize_item_ids": [
"T1"
]
},
{
"plan_step_summary": "Execution order 2: Add Timeline with persisted-vs-render validation first",
"finalize_item_ids": [
"T3"
]
},
{
"plan_step_summary": "Execution order 3: Add tests for unknown fields, missing theme, transient render theme, and classification",
"finalize_item_ids": [
"T8"
]
},
{
"plan_step_summary": "Execution order 4: Migrate timeline and paired Hype artifact reads after class behavior is proven",
"finalize_item_ids": [
"T6",
"T7",
"T8"
]
},
{
"plan_step_summary": "Execution order 5: Run grep-based checks before broad tests",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Execution order 6: Push Timeline commits, then restore user uncommitted work",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 1: Run pytest tests/test_timeline_roundtrip_fixture.py -q",
"finalize_item_ids": [
"T2",
"T9"
]
},
{
"plan_step_summary": "Validation order 2: Run focused Timeline and executor tests around render, validate, refine, cut, and publish serialization",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 3: Grep for direct JSON loads of named Hype artifacts in executor code paths",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 4: Run broad suite with documented exclusions",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 5: Run CLI list checks and hype dry-run smoke",
"finalize_item_ids": [
"T2",
"T9"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All approved main phase, execution order, and validation order steps are mapped. No human-only actions are required because the executor has writable repo access and the requested push/restore/test work is operational repo work, not an out-of-band human dependency. The only deliberate adjustment is to address FLAG-003 by running the non-smoke cut resume tests where feasible instead of ignoring the entire file.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Expected baseline includes the current xfail for unknown top-level Timeline field preservation before implementation; after Phase 2 the xfail marker must be removed and the test must pass unconditionally."
}
code
Debt watch items (do not make these worse):
None.
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T2]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC2]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/ArtAgents/.megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_2.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
git stash show --name-status stash@{1}
phase2-timeline-protect-untracked-test-write
.test_write
git stash show --include-untracked --name-status stash@{0}
jsonschema.exceptions.ValidationError: Additional properties are not allowed ('_phase2_canary' was unexpected)
raises=(_XFailExpected, AssertionError)
python3 -m artagents orchestrators list
builtin.hype
python3 -m artagents executors list
builtin.cut
builtin.render
builtin.validate
external.moirae
external.vibecomfy.*
code
Prior batch deviations (address if applicable):
[
"Best-effort checkpoint was not written because .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_2.json does not exist and is not writable.",
"Planned baseline said unknown top-level preservation should xfail, but actual baseline is a hard failure: pytest tests/test_timeline_roundtrip_fixture.py -q returned exit 1 with 1 failed, 2 passed.",
"Advisory: done tasks rely on commands_run without files_changed (FLAG-006 softening): T2",
"Advisory audit finding: Sense check SC3 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC4 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC5 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC6 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC7 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC8 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC9 is missing an executor acknowledgment."
]
code
User action prerequisites:
No user_action prerequisites for this batch.
Batch-scoped sense checks:
[
{
"id": "SC3",
"task_id": "T3",
"question": "Does Timeline.load().dump() preserve unknown top-level fields, allow a missing persisted theme, keep shared-schema validation, and keep clip/track validation closed without changing persisted field allowlists?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Protect the existing user work before editing: record branch, HEAD, and dirty state; inspect untracked files; stash the SKILL.md -> STAGE.md rename work with a clearly named stash entry; confirm the stash contains only that user work and the repo is clean for Timeline edits.",
"depends_on": [],
"status": "done",
"executor_notes": "Starting state recorded: cwd /Users/user_c042661f/Documents/reigh-workspace/ArtAgents, branch main, HEAD d58b4fae819ab0676cb723e9bfc67c3d5f2b2b72. Initial dirty state was the broad SKILL.md -> STAGE.md rename work plus an untracked zero-byte .test_write. Created named stash phase2-timeline-protect-skill-stage-rename-work; verified it contains tracked rename/doc/test support changes only via git stash show --name-status stash@{1}. Created separate stash phase2-timeline-protect-untracked-test-write for .test_write; verified with git stash show --include-untracked --name-status stash@{0}. Final git status --short --branch is clean: ## main...origin/main. No Timeline edits were made.",
"files_changed": [],
"commands_run": [
"git branch --show-current",
"git rev-parse HEAD",
"git status --short --branch",
"git status --porcelain=v1 -uall",
"git diff --stat",
"git diff --cached --stat",
"ls -l .test_write",
"git stash push -m "phase2-timeline-protect-skill-stage-rename-work"",
"git stash show --name-status stash@{1}",
"git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write",
"git stash show --include-untracked --name-status stash@{0}",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Run baseline checks before code changes: pytest tests/test_timeline_roundtrip_fixture.py -q, python3 -m artagents orchestrators list, and python3 -m artagents executors list. Record the expected xfail state for unknown top-level field preservation before changing it.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Pre-change worktree was clean on main. Ran pytest tests/test_timeline_roundtrip_fixture.py -q: result 1 failed, 2 passed. The byte-equivalent roundtrip and allowlist parity tests passed. TimelineRoundTripFixtureTest.test_unknown_top_level_field_is_preserved did not xfail as planned; it failed hard because shared-schema validation raised jsonschema.exceptions.ValidationError: Additional properties are not allowed ('_phase2_canary' was unexpected), which is outside the strict xfail marker's allowed raises=(_XFailExpected, AssertionError). Ran python3 -m artagents orchestrators list: passed and listed built-ins including builtin.hype. Ran python3 -m artagents executors list: passed and listed built-in/external executors including builtin.cut, builtin.render, builtin.validate, external.moirae, and external.vibecomfy.*. Final worktree remained clean.",
"files_changed": [],
"commands_run": [
"git status --short --branch",
"pytest tests/test_timeline_roundtrip_fixture.py -q",
"python3 -m artagents orchestrators list",
"python3 -m artagents executors list"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Implement the Timeline domain class in artagents/timeline.py. It must own persisted JSON load/dump, preserve unknown top-level fields, keep clip/track validation strict, continue using the shared JSON Schema, allow persisted timelines with no theme, expose typed properties for known fields, centralize from_/from JSON boundary conversion, and keep load_timeline() / save_timeline() as compatibility shims backed by the class.",
"depends_on": [
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Add runtime-only clip classification to the Timeline API. Derive classified_kind from clipType plus asset registry MIME/type, include an OPAQUE arm for unknown open-string clip types, and ensure no derived kind or classification fields can appear in persisted clip JSON.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add the transient render view API. Timeline.for_render(default_theme=\"banodoco-default\") must return a render-ready view where missing theme resolves to the default, without mutating the source Timeline and without making that injected theme dumpable back to persisted JSON. Move render JSON serialization details currently duplicated in the render executor into the Timeline API where appropriate.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T6",
"description": "Migrate executor and pipeline consumers of hype.timeline.json to the Timeline API or its compatibility shims. Cover the actual grep-discovered scope, including validate, refine, render, cut, publish, enriched arrangement, and pipeline reads/writes where applicable, while preserving existing behavior and byte-equivalent serialization.",
"depends_on": [
"T3",
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T7",
"description": "Migrate direct executor reads of paired Hype artifacts included in the grep gate: replace raw reads of hype.assets.json with artagents.timeline.load_registry(...) where validation is appropriate, and raw reads of hype.metadata.json with artagents.timeline.load_metadata(...). Do not broaden this into Pool, arrangement, transcript, scene, source media, or docs work.",
"depends_on": [
"T6"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T8",
"description": "Update tests for Phase 2 behavior. Remove the xfail marker from test_unknown_top_level_field_is_preserved; add or adjust focused tests proving unknown top-level preservation through Timeline and compatibility shims, missing-theme load/dump without persisted default injection, .for_render() transient theme behavior, and runtime-only clip classification with opaque unknown clip types. Keep allowlist parity unchanged.",
"depends_on": [
"T3",
"T4",
"T5",
"T6",
"T7"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T9",
"description": "Run final verification, fix failures, commit, push, and restore user work. Required checks: pytest tests/test_timeline_roundtrip_fixture.py -q; relevant focused executor tests after inspecting changed files; grep gate proving executor code no longer directly JSON-loads hype.timeline.json, hype.assets.json, or hype.metadata.json; broad suite using the documented exclusions but deselect only tests/test_cut_timeline_resume.py::CutTimelineResumeTest::test_resume_mode_render_smoke instead of ignoring the whole file if possible; python3 -m artagents orchestrators list; python3 -m artagents executors list; and a builtin.hype dry-run smoke after checking current syntax in artagents/orchestrators/hype/STAGE.md. Also write a short throwaway script under an ignored temp location that reproduces the missing-theme/unknown-top-level round-trip bug, run it to confirm the fix, then delete it. Commit focused changes, push directly to main, apply the saved user stash, and confirm the original SKILL/STAGE rename work is back in the working tree.",
"depends_on": [
"T8"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
],
"watch_items": [
"Do not invoke the megaplan CLI, read the megaplan skill, or start nested planning harnesses.",
"Start from /Users/user_c042661f/Documents/reigh-workspace/ArtAgents on main; push directly to main only after validation.",
"User SKILL.md -> STAGE.md rename work is unrelated and must be stashed before edits, untouched during implementation, and restored after pushing.",
"Do not infer read-only state. Attempt required edits and only report write failure after a concrete OS-level rejection and retry.",
"Do not persist clip.kind or any derived classification field. Reigh has a closed clip key allowlist and will reject unknown persisted keys.",
"Default theme injection is render-time only. .for_render() may expose a theme, but saved Timeline JSON must not gain a defaulted theme field.",
"Shared @banodoco/timeline-schema remains the schema source of truth. Avoid maintaining a new Python top-level allowlist for persisted Timeline fields.",
"Unknown top-level Timeline fields must be preserved, while clip and track unknown-key checks remain strict.",
"clipType is open-string; unknown values should classify as opaque rather than fail purely because the string is unfamiliar.",
"FLAG-003 remains open: avoid hiding regressions by ignoring all of tests/test_cut_timeline_resume.py; deselect only the documented pre-existing smoke failure if the test runner supports it.",
"Do not migrate Pool, AssetRegistry internals, arrangement, transcript, scene, source media, or broad docs beyond the named Hype artifact gate.",
"Round-trip byte equivalence for examples/hype.timeline.full.json is a hard regression gate.",
"Grep success criterion covers executor code paths for direct JSON reads of hype.timeline.json, hype.assets.json, and hype.metadata.json, not every unrelated JSON helper in the repo."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Was the pre-existing SKILL/STAGE rename work captured in a named stash, with branch/HEAD/dirty state recorded and no unrelated Timeline edits made before the stash?",
"executor_note": "Yes. The pre-existing SKILL/STAGE rename work was captured before Timeline edits in named stash phase2-timeline-protect-skill-stage-rename-work; branch/HEAD/dirty state were recorded; the only untracked file was inspected and separately stashed; final worktree is clean.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Do the baseline roundtrip fixture and CLI list commands establish the current behavior, including the expected unknown-top-level preservation xfail before Phase 2 edits?",
"executor_note": "Partially. The baseline fixture and CLI list commands establish current behavior, and both CLI list commands pass. However, the expected unknown-top-level preservation xfail is not currently an xfail: the fixture reports a hard failure because jsonschema.exceptions.ValidationError is raised before the test's _XFailExpected path.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does Timeline.load().dump() preserve unknown top-level fields, allow a missing persisted theme, keep shared-schema validation, and keep clip/track validation closed without changing persisted field allowlists?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Is clip classification derived only at runtime from clipType and registry MIME/type, with unknown clip types mapped to OPAQUE and no kind field written to JSON?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does .for_render() expose a renderable default theme when needed while leaving the original Timeline unchanged and unable to dump the injected theme?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Have all grep-discovered hype.timeline.json executor/pipeline reads and writes been routed through Timeline, load_timeline(), or save_timeline() without changing byte-equivalent output?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC7",
"task_id": "T7",
"question": "Are direct executor reads of hype.assets.json and hype.metadata.json migrated to typed loaders, with unrelated JSON artifacts left alone?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC8",
"task_id": "T8",
"question": "Do tests now assert unconditional unknown-top-level preservation, missing-theme persistence, transient render theme behavior, runtime-only classification, and unchanged allowlist parity?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC9",
"task_id": "T9",
"question": "Do the targeted tests, grep gate, broad suite with only documented exclusions, CLI smokes, hype dry-run smoke, and throwaway reproduction script all pass before commit/push, and is the user stash restored afterward?",
"executor_note": "",
"verdict": ""
}
],
"user_actions": [],
"meta_commentary": "Execution should proceed in a tight loop: protect user work first, prove the current baseline, implement Timeline invariants, then migrate consumers only as far as the named Hype artifact gate requires. The key design judgment is to separate persisted compatibility from render readiness: persisted timelines may omit theme and carry unknown top-level keys, while render views can inject defaults transiently. Keep JSON boundary mechanics in artagents/timeline.py; executor changes should become simpler, not grow new local serializers. Treat FLAG-003 as a validation refinement: the known bad smoke test can be deselected, but the rest of tests/test_cut_timeline_resume.py is relevant to this phase and should run if feasible.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Protect user work and establish baseline",
"finalize_item_ids": [
"T1",
"T2"
]
},
{
"plan_step_summary": "Step 2: Add Timeline with persisted-vs-render validation",
"finalize_item_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 3: Add runtime clip classification",
"finalize_item_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 4: Implement transient render view and update render executor serialization",
"finalize_item_ids": [
"T5",
"T6"
]
},
{
"plan_step_summary": "Step 5: Migrate Hype artifact consumers in executor paths",
"finalize_item_ids": [
"T6",
"T7"
]
},
{
"plan_step_summary": "Step 6: Update tests for Phase 2 behavior",
"finalize_item_ids": [
"T8"
]
},
{
"plan_step_summary": "Step 7: Validate broadly and commit",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Execution order 1: Stash user work before touching files",
"finalize_item_ids": [
"T1"
]
},
{
"plan_step_summary": "Execution order 2: Add Timeline with persisted-vs-render validation first",
"finalize_item_ids": [
"T3"
]
},
{
"plan_step_summary": "Execution order 3: Add tests for unknown fields, missing theme, transient render theme, and classification",
"finalize_item_ids": [
"T8"
]
},
{
"plan_step_summary": "Execution order 4: Migrate timeline and paired Hype artifact reads after class behavior is proven",
"finalize_item_ids": [
"T6",
"T7",
"T8"
]
},
{
"plan_step_summary": "Execution order 5: Run grep-based checks before broad tests",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Execution order 6: Push Timeline commits, then restore user uncommitted work",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 1: Run pytest tests/test_timeline_roundtrip_fixture.py -q",
"finalize_item_ids": [
"T2",
"T9"
]
},
{
"plan_step_summary": "Validation order 2: Run focused Timeline and executor tests around render, validate, refine, cut, and publish serialization",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 3: Grep for direct JSON loads of named Hype artifacts in executor code paths",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 4: Run broad suite with documented exclusions",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 5: Run CLI list checks and hype dry-run smoke",
"finalize_item_ids": [
"T2",
"T9"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All approved main phase, execution order, and validation order steps are mapped. No human-only actions are required because the executor has writable repo access and the requested push/restore/test work is operational repo work, not an out-of-band human dependency. The only deliberate adjustment is to address FLAG-003 by running the non-smoke cut resume tests where feasible instead of ignoring the entire file.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Expected baseline includes the current xfail for unknown top-level Timeline field preservation before implementation; after Phase 2 the xfail marker must be removed and the test must pass unconditionally."
}
code
Debt watch items (do not make these worse):
None.
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T3]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC3]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/ArtAgents/.megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_3.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
jsonschema.exceptions.ValidationError: Additional properties are not allowed ('_phase2_canary' was unexpected)
raises=(_XFailExpected, AssertionError)
python3 -m artagents orchestrators list
builtin.hype
python3 -m artagents executors list
builtin.cut
builtin.render
builtin.validate
external.moirae
external.vibecomfy.*
Timeline
artagents/timeline.py
theme
from_
from
load_timeline()
save_timeline()
Timeline
artagents/timeline.py
Timeline.load()
from
from_
Timeline.dump()
from_
from
load_timeline()
save_timeline()
TimelineConfig
theme
theme
clips
tracks
theme_overrides
generation_defaults
pinnedShotGroups
output
python3 -m py_compile artagents/timeline.py
Timeline.load().dump()
_phase2_canary
theme
tests/test_timeline_roundtrip_fixture.py
2 passed, 1 failed
code
Prior batch deviations (address if applicable):
[
"Best-effort checkpoint was not written because .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_3.json does not exist and is not writable.",
"pytest tests/test_timeline_roundtrip_fixture.py -q now fails as XPASS(strict) for test_unknown_top_level_field_is_preserved; this is the expected intermediate state because T3 made the behavior pass while T8 owns removing the xfail marker.",
"Advisory quality: code changes lacked test updates: artagents/timeline.py.",
"Advisory audit finding: Sense check SC4 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC5 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC6 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC7 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC8 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC9 is missing an executor acknowledgment."
]
code
User action prerequisites:
No user_action prerequisites for this batch.
Batch-scoped sense checks:
[
{
"id": "SC4",
"task_id": "T4",
"question": "Is clip classification derived only at runtime from clipType and registry MIME/type, with unknown clip types mapped to OPAQUE and no kind field written to JSON?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does .for_render() expose a renderable default theme when needed while leaving the original Timeline unchanged and unable to dump the injected theme?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Protect the existing user work before editing: record branch, HEAD, and dirty state; inspect untracked files; stash the SKILL.md -> STAGE.md rename work with a clearly named stash entry; confirm the stash contains only that user work and the repo is clean for Timeline edits.",
"depends_on": [],
"status": "done",
"executor_notes": "Starting state recorded: cwd /Users/user_c042661f/Documents/reigh-workspace/ArtAgents, branch main, HEAD d58b4fae819ab0676cb723e9bfc67c3d5f2b2b72. Initial dirty state was the broad SKILL.md -> STAGE.md rename work plus an untracked zero-byte .test_write. Created named stash phase2-timeline-protect-skill-stage-rename-work; verified it contains tracked rename/doc/test support changes only via git stash show --name-status stash@{1}. Created separate stash phase2-timeline-protect-untracked-test-write for .test_write; verified with git stash show --include-untracked --name-status stash@{0}. Final git status --short --branch is clean: ## main...origin/main. No Timeline edits were made.",
"files_changed": [],
"commands_run": [
"git branch --show-current",
"git rev-parse HEAD",
"git status --short --branch",
"git status --porcelain=v1 -uall",
"git diff --stat",
"git diff --cached --stat",
"ls -l .test_write",
"git stash push -m "phase2-timeline-protect-skill-stage-rename-work"",
"git stash show --name-status stash@{1}",
"git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write",
"git stash show --include-untracked --name-status stash@{0}",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Run baseline checks before code changes: pytest tests/test_timeline_roundtrip_fixture.py -q, python3 -m artagents orchestrators list, and python3 -m artagents executors list. Record the expected xfail state for unknown top-level field preservation before changing it.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Pre-change worktree was clean on main. Ran pytest tests/test_timeline_roundtrip_fixture.py -q: result 1 failed, 2 passed. The byte-equivalent roundtrip and allowlist parity tests passed. TimelineRoundTripFixtureTest.test_unknown_top_level_field_is_preserved did not xfail as planned; it failed hard because shared-schema validation raised jsonschema.exceptions.ValidationError: Additional properties are not allowed ('_phase2_canary' was unexpected), which is outside the strict xfail marker's allowed raises=(_XFailExpected, AssertionError). Ran python3 -m artagents orchestrators list: passed and listed built-ins including builtin.hype. Ran python3 -m artagents executors list: passed and listed built-in/external executors including builtin.cut, builtin.render, builtin.validate, external.moirae, and external.vibecomfy.*. Final worktree remained clean.",
"files_changed": [],
"commands_run": [
"git status --short --branch",
"pytest tests/test_timeline_roundtrip_fixture.py -q",
"python3 -m artagents orchestrators list",
"python3 -m artagents executors list"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Implement the Timeline domain class in artagents/timeline.py. It must own persisted JSON load/dump, preserve unknown top-level fields, keep clip/track validation strict, continue using the shared JSON Schema, allow persisted timelines with no theme, expose typed properties for known fields, centralize from_/from JSON boundary conversion, and keep load_timeline() / save_timeline() as compatibility shims backed by the class.",
"depends_on": [
"T2"
],
"status": "done",
"executor_notes": "Implemented Timeline in artagents/timeline.py. Timeline.load() reads JSON and converts persisted from to in-memory from_; Timeline.dump() writes JSON and converts from_ back to from. load_timeline() and save_timeline() now delegate through the class while continuing to return/accept dict-compatible TimelineConfig values. Unknown top-level fields are preserved by construction, while shared-schema validation still runs against the known persisted Timeline subset and local clip/track validation remains closed. Missing persisted theme is now accepted; non-string/empty theme values still fail. Typed accessors were added for theme, clips, tracks, theme_overrides, generation_defaults, pinnedShotGroups, and output. Verification: python3 -m py_compile artagents/timeline.py passed. A focused Timeline smoke confirmed Timeline.load().dump() and compatibility shims preserve _phase2_canary, omit missing theme, and reject an unknown clip key. The full tests/test_timeline_roundtrip_fixture.py module now reports 2 passed, 1 failed only because the unknown-field test is a strict XPASS pending T8 marker removal.",
"files_changed": [
"artagents/timeline.py"
],
"commands_run": [
"python3 -m py_compile artagents/timeline.py",
"pytest tests/test_timeline_roundtrip_fixture.py -q",
"python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.timeline import Timeline, load_timeline, save_timeline\n\nfixture = Path('examples/hype.timeline.full.json')\nbase = json.loads(fixture.read_text(encoding='utf-8'))\nwith tempfile.TemporaryDirectory() as tmp:\n tmp = Path(tmp)\n payload = dict(base)\n payload['_phase2_canary'] = 'preserve me'\n payload.pop('theme', None)\n in_path = tmp / 'timeline.json'\n out_path = tmp / 'out.json'\n in_path.write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')\n timeline = Timeline.load(in_path)\n assert timeline.theme is None\n assert timeline.clips\n timeline.dump(out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n config = load_timeline(in_path)\n save_timeline(config, out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n bad = dict(base)\n bad['clips'] = [dict(base['clips'][0], unexpected='nope')]\n bad_path = tmp / 'bad.json'\n bad_path.write_text(json.dumps(bad, indent=2) + '\n', encoding='utf-8')\n try:\n Timeline.load(bad_path)\n except Exception as exc:\n assert 'unexpected' in str(exc)\n else:\n raise AssertionError('unknown clip key was accepted')\nprint('timeline domain smoke passed')\nPY",
"git diff -- artagents/timeline.py",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Add runtime-only clip classification to the Timeline API. Derive classified_kind from clipType plus asset registry MIME/type, include an OPAQUE arm for unknown open-string clip types, and ensure no derived kind or classification fields can appear in persisted clip JSON.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add the transient render view API. Timeline.for_render(default_theme=\"banodoco-default\") must return a render-ready view where missing theme resolves to the default, without mutating the source Timeline and without making that injected theme dumpable back to persisted JSON. Move render JSON serialization details currently duplicated in the render executor into the Timeline API where appropriate.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T6",
"description": "Migrate executor and pipeline consumers of hype.timeline.json to the Timeline API or its compatibility shims. Cover the actual grep-discovered scope, including validate, refine, render, cut, publish, enriched arrangement, and pipeline reads/writes where applicable, while preserving existing behavior and byte-equivalent serialization.",
"depends_on": [
"T3",
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T7",
"description": "Migrate direct executor reads of paired Hype artifacts included in the grep gate: replace raw reads of hype.assets.json with artagents.timeline.load_registry(...) where validation is appropriate, and raw reads of hype.metadata.json with artagents.timeline.load_metadata(...). Do not broaden this into Pool, arrangement, transcript, scene, source media, or docs work.",
"depends_on": [
"T6"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T8",
"description": "Update tests for Phase 2 behavior. Remove the xfail marker from test_unknown_top_level_field_is_preserved; add or adjust focused tests proving unknown top-level preservation through Timeline and compatibility shims, missing-theme load/dump without persisted default injection, .for_render() transient theme behavior, and runtime-only clip classification with opaque unknown clip types. Keep allowlist parity unchanged.",
"depends_on": [
"T3",
"T4",
"T5",
"T6",
"T7"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T9",
"description": "Run final verification, fix failures, commit, push, and restore user work. Required checks: pytest tests/test_timeline_roundtrip_fixture.py -q; relevant focused executor tests after inspecting changed files; grep gate proving executor code no longer directly JSON-loads hype.timeline.json, hype.assets.json, or hype.metadata.json; broad suite using the documented exclusions but deselect only tests/test_cut_timeline_resume.py::CutTimelineResumeTest::test_resume_mode_render_smoke instead of ignoring the whole file if possible; python3 -m artagents orchestrators list; python3 -m artagents executors list; and a builtin.hype dry-run smoke after checking current syntax in artagents/orchestrators/hype/STAGE.md. Also write a short throwaway script under an ignored temp location that reproduces the missing-theme/unknown-top-level round-trip bug, run it to confirm the fix, then delete it. Commit focused changes, push directly to main, apply the saved user stash, and confirm the original SKILL/STAGE rename work is back in the working tree.",
"depends_on": [
"T8"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
],
"watch_items": [
"Do not invoke the megaplan CLI, read the megaplan skill, or start nested planning harnesses.",
"Start from /Users/user_c042661f/Documents/reigh-workspace/ArtAgents on main; push directly to main only after validation.",
"User SKILL.md -> STAGE.md rename work is unrelated and must be stashed before edits, untouched during implementation, and restored after pushing.",
"Do not infer read-only state. Attempt required edits and only report write failure after a concrete OS-level rejection and retry.",
"Do not persist clip.kind or any derived classification field. Reigh has a closed clip key allowlist and will reject unknown persisted keys.",
"Default theme injection is render-time only. .for_render() may expose a theme, but saved Timeline JSON must not gain a defaulted theme field.",
"Shared @banodoco/timeline-schema remains the schema source of truth. Avoid maintaining a new Python top-level allowlist for persisted Timeline fields.",
"Unknown top-level Timeline fields must be preserved, while clip and track unknown-key checks remain strict.",
"clipType is open-string; unknown values should classify as opaque rather than fail purely because the string is unfamiliar.",
"FLAG-003 remains open: avoid hiding regressions by ignoring all of tests/test_cut_timeline_resume.py; deselect only the documented pre-existing smoke failure if the test runner supports it.",
"Do not migrate Pool, AssetRegistry internals, arrangement, transcript, scene, source media, or broad docs beyond the named Hype artifact gate.",
"Round-trip byte equivalence for examples/hype.timeline.full.json is a hard regression gate.",
"Grep success criterion covers executor code paths for direct JSON reads of hype.timeline.json, hype.assets.json, and hype.metadata.json, not every unrelated JSON helper in the repo."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Was the pre-existing SKILL/STAGE rename work captured in a named stash, with branch/HEAD/dirty state recorded and no unrelated Timeline edits made before the stash?",
"executor_note": "Yes. The pre-existing SKILL/STAGE rename work was captured before Timeline edits in named stash phase2-timeline-protect-skill-stage-rename-work; branch/HEAD/dirty state were recorded; the only untracked file was inspected and separately stashed; final worktree is clean.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Do the baseline roundtrip fixture and CLI list commands establish the current behavior, including the expected unknown-top-level preservation xfail before Phase 2 edits?",
"executor_note": "Partially. The baseline fixture and CLI list commands establish current behavior, and both CLI list commands pass. However, the expected unknown-top-level preservation xfail is not currently an xfail: the fixture reports a hard failure because jsonschema.exceptions.ValidationError is raised before the test's _XFailExpected path.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does Timeline.load().dump() preserve unknown top-level fields, allow a missing persisted theme, keep shared-schema validation, and keep clip/track validation closed without changing persisted field allowlists?",
"executor_note": "Yes. Timeline.load().dump() now preserves unknown top-level fields, accepts a missing persisted theme, keeps shared-schema validation for known Timeline fields, and still rejects unknown clip keys. _TIMELINE_TOP_ALLOWED, _CLIP_ALLOWED, and _TRACK_ALLOWED were not changed, so persisted allowlist parity is unchanged.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Is clip classification derived only at runtime from clipType and registry MIME/type, with unknown clip types mapped to OPAQUE and no kind field written to JSON?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does .for_render() expose a renderable default theme when needed while leaving the original Timeline unchanged and unable to dump the injected theme?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Have all grep-discovered hype.timeline.json executor/pipeline reads and writes been routed through Timeline, load_timeline(), or save_timeline() without changing byte-equivalent output?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC7",
"task_id": "T7",
"question": "Are direct executor reads of hype.assets.json and hype.metadata.json migrated to typed loaders, with unrelated JSON artifacts left alone?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC8",
"task_id": "T8",
"question": "Do tests now assert unconditional unknown-top-level preservation, missing-theme persistence, transient render theme behavior, runtime-only classification, and unchanged allowlist parity?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC9",
"task_id": "T9",
"question": "Do the targeted tests, grep gate, broad suite with only documented exclusions, CLI smokes, hype dry-run smoke, and throwaway reproduction script all pass before commit/push, and is the user stash restored afterward?",
"executor_note": "",
"verdict": ""
}
],
"user_actions": [],
"meta_commentary": "Execution should proceed in a tight loop: protect user work first, prove the current baseline, implement Timeline invariants, then migrate consumers only as far as the named Hype artifact gate requires. The key design judgment is to separate persisted compatibility from render readiness: persisted timelines may omit theme and carry unknown top-level keys, while render views can inject defaults transiently. Keep JSON boundary mechanics in artagents/timeline.py; executor changes should become simpler, not grow new local serializers. Treat FLAG-003 as a validation refinement: the known bad smoke test can be deselected, but the rest of tests/test_cut_timeline_resume.py is relevant to this phase and should run if feasible.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Protect user work and establish baseline",
"finalize_item_ids": [
"T1",
"T2"
]
},
{
"plan_step_summary": "Step 2: Add Timeline with persisted-vs-render validation",
"finalize_item_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 3: Add runtime clip classification",
"finalize_item_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 4: Implement transient render view and update render executor serialization",
"finalize_item_ids": [
"T5",
"T6"
]
},
{
"plan_step_summary": "Step 5: Migrate Hype artifact consumers in executor paths",
"finalize_item_ids": [
"T6",
"T7"
]
},
{
"plan_step_summary": "Step 6: Update tests for Phase 2 behavior",
"finalize_item_ids": [
"T8"
]
},
{
"plan_step_summary": "Step 7: Validate broadly and commit",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Execution order 1: Stash user work before touching files",
"finalize_item_ids": [
"T1"
]
},
{
"plan_step_summary": "Execution order 2: Add Timeline with persisted-vs-render validation first",
"finalize_item_ids": [
"T3"
]
},
{
"plan_step_summary": "Execution order 3: Add tests for unknown fields, missing theme, transient render theme, and classification",
"finalize_item_ids": [
"T8"
]
},
{
"plan_step_summary": "Execution order 4: Migrate timeline and paired Hype artifact reads after class behavior is proven",
"finalize_item_ids": [
"T6",
"T7",
"T8"
]
},
{
"plan_step_summary": "Execution order 5: Run grep-based checks before broad tests",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Execution order 6: Push Timeline commits, then restore user uncommitted work",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 1: Run pytest tests/test_timeline_roundtrip_fixture.py -q",
"finalize_item_ids": [
"T2",
"T9"
]
},
{
"plan_step_summary": "Validation order 2: Run focused Timeline and executor tests around render, validate, refine, cut, and publish serialization",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 3: Grep for direct JSON loads of named Hype artifacts in executor code paths",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 4: Run broad suite with documented exclusions",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 5: Run CLI list checks and hype dry-run smoke",
"finalize_item_ids": [
"T2",
"T9"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All approved main phase, execution order, and validation order steps are mapped. No human-only actions are required because the executor has writable repo access and the requested push/restore/test work is operational repo work, not an out-of-band human dependency. The only deliberate adjustment is to address FLAG-003 by running the non-smoke cut resume tests where feasible instead of ignoring the entire file.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Expected baseline includes the current xfail for unknown top-level Timeline field preservation before implementation; after Phase 2 the xfail marker must be removed and the test must pass unconditionally."
}
code
Debt watch items (do not make these worse):
None.
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T4, T5]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC4, SC5]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/ArtAgents/.megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_4.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
.test_write
git stash show --include-untracked --name-status stash@{0}
"Best-effort checkpoint was not written because .megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_4.json does not exist and is not writable.",
"pytest tests/test_timeline_roundtrip_fixture.py -q still fails as XPASS(strict) for unknown top-level preservation; T8 owns removing the xfail marker.",
"pytest tests/test_schema_contract.py -q reports 2 failures: generated type byte stability and the old missing-theme rejection expectation. The missing-theme test is now intentionally obsolete after T3/T5; the generated type byte-stability failure needs handling in the later test-update/regeneration batch if it remains part of the suite.",
"Advisory quality: artagents/executors/render/run.py adds unused imports: ThemeValidationError.",
"Advisory quality: code changes lacked test updates: artagents/executors/render/run.py, artagents/timeline.py.",
"Advisory audit finding: Sense check SC6 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC7 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC8 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC9 is missing an executor acknowledgment."
]
code
User action prerequisites:
No user_action prerequisites for this batch.
Batch-scoped sense checks:
[
{
"id": "SC6",
"task_id": "T6",
"question": "Have all grep-discovered hype.timeline.json executor/pipeline reads and writes been routed through Timeline, load_timeline(), or save_timeline() without changing byte-equivalent output?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Protect the existing user work before editing: record branch, HEAD, and dirty state; inspect untracked files; stash the SKILL.md -> STAGE.md rename work with a clearly named stash entry; confirm the stash contains only that user work and the repo is clean for Timeline edits.",
"depends_on": [],
"status": "done",
"executor_notes": "Starting state recorded: cwd /Users/user_c042661f/Documents/reigh-workspace/ArtAgents, branch main, HEAD d58b4fae819ab0676cb723e9bfc67c3d5f2b2b72. Initial dirty state was the broad SKILL.md -> STAGE.md rename work plus an untracked zero-byte .test_write. Created named stash phase2-timeline-protect-skill-stage-rename-work; verified it contains tracked rename/doc/test support changes only via git stash show --name-status stash@{1}. Created separate stash phase2-timeline-protect-untracked-test-write for .test_write; verified with git stash show --include-untracked --name-status stash@{0}. Final git status --short --branch is clean: ## main...origin/main. No Timeline edits were made.",
"files_changed": [],
"commands_run": [
"git branch --show-current",
"git rev-parse HEAD",
"git status --short --branch",
"git status --porcelain=v1 -uall",
"git diff --stat",
"git diff --cached --stat",
"ls -l .test_write",
"git stash push -m "phase2-timeline-protect-skill-stage-rename-work"",
"git stash show --name-status stash@{1}",
"git stash push -u -m "phase2-timeline-protect-untracked-test-write" -- .test_write",
"git stash show --include-untracked --name-status stash@{0}",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Run baseline checks before code changes: pytest tests/test_timeline_roundtrip_fixture.py -q, python3 -m artagents orchestrators list, and python3 -m artagents executors list. Record the expected xfail state for unknown top-level field preservation before changing it.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Pre-change worktree was clean on main. Ran pytest tests/test_timeline_roundtrip_fixture.py -q: result 1 failed, 2 passed. The byte-equivalent roundtrip and allowlist parity tests passed. TimelineRoundTripFixtureTest.test_unknown_top_level_field_is_preserved did not xfail as planned; it failed hard because shared-schema validation raised jsonschema.exceptions.ValidationError: Additional properties are not allowed ('_phase2_canary' was unexpected), which is outside the strict xfail marker's allowed raises=(_XFailExpected, AssertionError). Ran python3 -m artagents orchestrators list: passed and listed built-ins including builtin.hype. Ran python3 -m artagents executors list: passed and listed built-in/external executors including builtin.cut, builtin.render, builtin.validate, external.moirae, and external.vibecomfy.*. Final worktree remained clean.",
"files_changed": [],
"commands_run": [
"git status --short --branch",
"pytest tests/test_timeline_roundtrip_fixture.py -q",
"python3 -m artagents orchestrators list",
"python3 -m artagents executors list"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Implement the Timeline domain class in artagents/timeline.py. It must own persisted JSON load/dump, preserve unknown top-level fields, keep clip/track validation strict, continue using the shared JSON Schema, allow persisted timelines with no theme, expose typed properties for known fields, centralize from_/from JSON boundary conversion, and keep load_timeline() / save_timeline() as compatibility shims backed by the class.",
"depends_on": [
"T2"
],
"status": "done",
"executor_notes": "Implemented Timeline in artagents/timeline.py. Timeline.load() reads JSON and converts persisted from to in-memory from_; Timeline.dump() writes JSON and converts from_ back to from. load_timeline() and save_timeline() now delegate through the class while continuing to return/accept dict-compatible TimelineConfig values. Unknown top-level fields are preserved by construction, while shared-schema validation still runs against the known persisted Timeline subset and local clip/track validation remains closed. Missing persisted theme is now accepted; non-string/empty theme values still fail. Typed accessors were added for theme, clips, tracks, theme_overrides, generation_defaults, pinnedShotGroups, and output. Verification: python3 -m py_compile artagents/timeline.py passed. A focused Timeline smoke confirmed Timeline.load().dump() and compatibility shims preserve _phase2_canary, omit missing theme, and reject an unknown clip key. The full tests/test_timeline_roundtrip_fixture.py module now reports 2 passed, 1 failed only because the unknown-field test is a strict XPASS pending T8 marker removal.",
"files_changed": [
"artagents/timeline.py"
],
"commands_run": [
"python3 -m py_compile artagents/timeline.py",
"pytest tests/test_timeline_roundtrip_fixture.py -q",
"python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.timeline import Timeline, load_timeline, save_timeline\n\nfixture = Path('examples/hype.timeline.full.json')\nbase = json.loads(fixture.read_text(encoding='utf-8'))\nwith tempfile.TemporaryDirectory() as tmp:\n tmp = Path(tmp)\n payload = dict(base)\n payload['_phase2_canary'] = 'preserve me'\n payload.pop('theme', None)\n in_path = tmp / 'timeline.json'\n out_path = tmp / 'out.json'\n in_path.write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')\n timeline = Timeline.load(in_path)\n assert timeline.theme is None\n assert timeline.clips\n timeline.dump(out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n config = load_timeline(in_path)\n save_timeline(config, out_path)\n after = json.loads(out_path.read_text(encoding='utf-8'))\n assert after['_phase2_canary'] == 'preserve me'\n assert 'theme' not in after\n\n bad = dict(base)\n bad['clips'] = [dict(base['clips'][0], unexpected='nope')]\n bad_path = tmp / 'bad.json'\n bad_path.write_text(json.dumps(bad, indent=2) + '\n', encoding='utf-8')\n try:\n Timeline.load(bad_path)\n except Exception as exc:\n assert 'unexpected' in str(exc)\n else:\n raise AssertionError('unknown clip key was accepted')\nprint('timeline domain smoke passed')\nPY",
"git diff -- artagents/timeline.py",
"git status --short --branch"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Add runtime-only clip classification to the Timeline API. Derive classified_kind from clipType plus asset registry MIME/type, include an OPAQUE arm for unknown open-string clip types, and ensure no derived kind or classification fields can appear in persisted clip JSON.",
"depends_on": [
"T3"
],
"status": "done",
"executor_notes": "Added ClipClassifiedKind with VIDEO, IMAGE, AUDIO, TEXT, EFFECT, and OPAQUE arms plus TimelineClipView.classified_kind. Classification is derived at runtime from clipType and, for media/hold clips, registry entry type or MIME-style fields (mime, mimeType, contentType). Unknown open-string clipType values now validate and classify as OPAQUE instead of failing solely because the string is unfamiliar. A focused smoke verified media classification from registry type/MIME, text classification, unknown clipType -> OPAQUE, and no persisted kind or classified_kind fields in either render JSON clips or dumped timeline JSON.",
"files_changed": [
"artagents/timeline.py"
],
"commands_run": [
"python3 -m py_compile artagents/timeline.py artagents/executors/render/run.py",
"python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.timeline import ClipClassifiedKind, Timeline, validate_timeline\n\nbase = json.loads(Path('examples/hype.timeline.full.json').read_text(encoding='utf-8'))\nbase.pop('theme', None)\nbase['clips'] = [\n {'id': 'v', 'at': 0, 'track': 'v1', 'clipType': 'media', 'asset': 'video'},\n {'id': 'i', 'at': 1, 'track': 'v1', 'clipType': 'media', 'asset': 'image'},\n {'id': 'a', 'at': 2, 'track': 'a1', 'clipType': 'media', 'asset': 'audio'},\n {'id': 't', 'at': 3, 'track': 'v1', 'clipType': 'text'},\n {'id': 'u', 'at': 4, 'track': 'v1', 'clipType': 'future-reigh-clip'},\n]\nregistry = {\n 'assets': {\n 'video': {'file': '/tmp/v.mp4', 'type': 'video'},\n 'image': {'file': '/tmp/i.png', 'mimeType': 'image/png'},\n 'audio': {'file': '/tmp/a.wav', 'contentType': 'audio/wav'},\n }\n}\nvalidate_timeline(base)\ntimeline = Timeline.from_config(base)\nassert [view.classified_kind for view in timeline.classified_clips(registry)] == [\n ClipClassifiedKind.VIDEO,\n ClipClassifiedKind.IMAGE,\n ClipClassifiedKind.AUDIO,\n ClipClassifiedKind.TEXT,\n ClipClassifiedKind.OPAQUE,\n]\nrender_view = timeline.for_render()\nassert timeline.theme is None\nassert render_view.theme == 'banodoco-default'\nrender_json = render_view.to_json_data()\nassert render_json['theme'] == 'banodoco-default'\nfor clip in render_json['clips']:\n assert 'kind' not in clip\n assert 'classified_kind' not in clip\nwith tempfile.TemporaryDirectory() as tmp:\n out = Path(tmp) / 'timeline.json'\n timeline.dump(out)\n persisted = json.loads(out.read_text(encoding='utf-8'))\n assert 'theme' not in persisted\n for clip in persisted['clips']:\n assert 'kind' not in clip\n assert 'classified_kind' not in clip\nprint('classification and render view smoke passed')\nPY",
"pytest tests/test_schema_contract.py -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add the transient render view API. Timeline.for_render(default_theme=\"banodoco-default\") must return a render-ready view where missing theme resolves to the default, without mutating the source Timeline and without making that injected theme dumpable back to persisted JSON. Move render JSON serialization details currently duplicated in the render executor into the Timeline API where appropriate.",
"depends_on": [
"T3"
],
"status": "done",
"executor_notes": "Added TimelineRenderView and Timeline.for_render(default_theme=\"banodoco-default\"). The render view exposes a renderable theme when the persisted timeline omits theme, returns render JSON with the default theme injected, and does not mutate or dump that default through Timeline.dump(). Updated artagents/executors/render/run.py so _serialize_timeline() uses Timeline.load(...).for_render(...).to_json_data() instead of duplicating from_/from serialization, and _resolved_theme_for_render() uses a transient timeline config with the render default only for theme resolution. Verification: py_compile passed, pytest tests/test_render_remotion_registry.py -q passed, and a render serialization smoke proved missing-theme props get banodoco-default while the source JSON remains without theme.",
"files_changed": [
"artagents/timeline.py",
"artagents/executors/render/run.py"
],
"commands_run": [
"python3 -m py_compile artagents/timeline.py artagents/executors/render/run.py",
"pytest tests/test_render_remotion_registry.py -q",
"python3 - <<'PY'\nimport json\nimport tempfile\nfrom pathlib import Path\nfrom artagents.executors.render.run import _serialize_timeline\n\npayload = json.loads(Path('examples/hype.timeline.full.json').read_text(encoding='utf-8'))\npayload.pop('theme', None)\nwith tempfile.TemporaryDirectory() as tmp:\n path = Path(tmp) / 'timeline.json'\n path.write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')\n props_timeline = _serialize_timeline(path)\n persisted = json.loads(path.read_text(encoding='utf-8'))\n assert props_timeline['theme'] == 'banodoco-default'\n assert 'theme' not in persisted\nprint('render serialization smoke passed')\nPY",
"pytest tests/test_timeline_roundtrip_fixture.py -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T6",
"description": "Migrate executor and pipeline consumers of hype.timeline.json to the Timeline API or its compatibility shims. Cover the actual grep-discovered scope, including validate, refine, render, cut, publish, enriched arrangement, and pipeline reads/writes where applicable, while preserving existing behavior and byte-equivalent serialization.",
"depends_on": [
"T3",
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T7",
"description": "Migrate direct executor reads of paired Hype artifacts included in the grep gate: replace raw reads of hype.assets.json with artagents.timeline.load_registry(...) where validation is appropriate, and raw reads of hype.metadata.json with artagents.timeline.load_metadata(...). Do not broaden this into Pool, arrangement, transcript, scene, source media, or docs work.",
"depends_on": [
"T6"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T8",
"description": "Update tests for Phase 2 behavior. Remove the xfail marker from test_unknown_top_level_field_is_preserved; add or adjust focused tests proving unknown top-level preservation through Timeline and compatibility shims, missing-theme load/dump without persisted default injection, .for_render() transient theme behavior, and runtime-only clip classification with opaque unknown clip types. Keep allowlist parity unchanged.",
"depends_on": [
"T3",
"T4",
"T5",
"T6",
"T7"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T9",
"description": "Run final verification, fix failures, commit, push, and restore user work. Required checks: pytest tests/test_timeline_roundtrip_fixture.py -q; relevant focused executor tests after inspecting changed files; grep gate proving executor code no longer directly JSON-loads hype.timeline.json, hype.assets.json, or hype.metadata.json; broad suite using the documented exclusions but deselect only tests/test_cut_timeline_resume.py::CutTimelineResumeTest::test_resume_mode_render_smoke instead of ignoring the whole file if possible; python3 -m artagents orchestrators list; python3 -m artagents executors list; and a builtin.hype dry-run smoke after checking current syntax in artagents/orchestrators/hype/STAGE.md. Also write a short throwaway script under an ignored temp location that reproduces the missing-theme/unknown-top-level round-trip bug, run it to confirm the fix, then delete it. Commit focused changes, push directly to main, apply the saved user stash, and confirm the original SKILL/STAGE rename work is back in the working tree.",
"depends_on": [
"T8"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
],
"watch_items": [
"Do not invoke the megaplan CLI, read the megaplan skill, or start nested planning harnesses.",
"Start from /Users/user_c042661f/Documents/reigh-workspace/ArtAgents on main; push directly to main only after validation.",
"User SKILL.md -> STAGE.md rename work is unrelated and must be stashed before edits, untouched during implementation, and restored after pushing.",
"Do not infer read-only state. Attempt required edits and only report write failure after a concrete OS-level rejection and retry.",
"Do not persist clip.kind or any derived classification field. Reigh has a closed clip key allowlist and will reject unknown persisted keys.",
"Default theme injection is render-time only. .for_render() may expose a theme, but saved Timeline JSON must not gain a defaulted theme field.",
"Shared @banodoco/timeline-schema remains the schema source of truth. Avoid maintaining a new Python top-level allowlist for persisted Timeline fields.",
"Unknown top-level Timeline fields must be preserved, while clip and track unknown-key checks remain strict.",
"clipType is open-string; unknown values should classify as opaque rather than fail purely because the string is unfamiliar.",
"FLAG-003 remains open: avoid hiding regressions by ignoring all of tests/test_cut_timeline_resume.py; deselect only the documented pre-existing smoke failure if the test runner supports it.",
"Do not migrate Pool, AssetRegistry internals, arrangement, transcript, scene, source media, or broad docs beyond the named Hype artifact gate.",
"Round-trip byte equivalence for examples/hype.timeline.full.json is a hard regression gate.",
"Grep success criterion covers executor code paths for direct JSON reads of hype.timeline.json, hype.assets.json, and hype.metadata.json, not every unrelated JSON helper in the repo."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Was the pre-existing SKILL/STAGE rename work captured in a named stash, with branch/HEAD/dirty state recorded and no unrelated Timeline edits made before the stash?",
"executor_note": "Yes. The pre-existing SKILL/STAGE rename work was captured before Timeline edits in named stash phase2-timeline-protect-skill-stage-rename-work; branch/HEAD/dirty state were recorded; the only untracked file was inspected and separately stashed; final worktree is clean.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Do the baseline roundtrip fixture and CLI list commands establish the current behavior, including the expected unknown-top-level preservation xfail before Phase 2 edits?",
"executor_note": "Partially. The baseline fixture and CLI list commands establish current behavior, and both CLI list commands pass. However, the expected unknown-top-level preservation xfail is not currently an xfail: the fixture reports a hard failure because jsonschema.exceptions.ValidationError is raised before the test's _XFailExpected path.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does Timeline.load().dump() preserve unknown top-level fields, allow a missing persisted theme, keep shared-schema validation, and keep clip/track validation closed without changing persisted field allowlists?",
"executor_note": "Yes. Timeline.load().dump() now preserves unknown top-level fields, accepts a missing persisted theme, keeps shared-schema validation for known Timeline fields, and still rejects unknown clip keys. _TIMELINE_TOP_ALLOWED, _CLIP_ALLOWED, and _TRACK_ALLOWED were not changed, so persisted allowlist parity is unchanged.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Is clip classification derived only at runtime from clipType and registry MIME/type, with unknown clip types mapped to OPAQUE and no kind field written to JSON?",
"executor_note": "Yes. Classification is runtime-only via TimelineClipView.classified_kind, derived from clipType and registry type/MIME data. Unknown open-string clipType values classify as OPAQUE. Smoke verification confirmed neither kind nor classified_kind appears in render JSON clips or persisted timeline JSON.",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does .for_render() expose a renderable default theme when needed while leaving the original Timeline unchanged and unable to dump the injected theme?",
"executor_note": "Yes. .for_render() exposes banodoco-default when theme is missing, leaves the source Timeline.theme as None, and Timeline.dump() still omits the injected theme. Render executor props serialization now uses the transient render view.",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Have all grep-discovered hype.timeline.json executor/pipeline reads and writes been routed through Timeline, load_timeline(), or save_timeline() without changing byte-equivalent output?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC7",
"task_id": "T7",
"question": "Are direct executor reads of hype.assets.json and hype.metadata.json migrated to typed loaders, with unrelated JSON artifacts left alone?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC8",
"task_id": "T8",
"question": "Do tests now assert unconditional unknown-top-level preservation, missing-theme persistence, transient render theme behavior, runtime-only classification, and unchanged allowlist parity?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC9",
"task_id": "T9",
"question": "Do the targeted tests, grep gate, broad suite with only documented exclusions, CLI smokes, hype dry-run smoke, and throwaway reproduction script all pass before commit/push, and is the user stash restored afterward?",
"executor_note": "",
"verdict": ""
}
],
"user_actions": [],
"meta_commentary": "Execution should proceed in a tight loop: protect user work first, prove the current baseline, implement Timeline invariants, then migrate consumers only as far as the named Hype artifact gate requires. The key design judgment is to separate persisted compatibility from render readiness: persisted timelines may omit theme and carry unknown top-level keys, while render views can inject defaults transiently. Keep JSON boundary mechanics in artagents/timeline.py; executor changes should become simpler, not grow new local serializers. Treat FLAG-003 as a validation refinement: the known bad smoke test can be deselected, but the rest of tests/test_cut_timeline_resume.py is relevant to this phase and should run if feasible.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Protect user work and establish baseline",
"finalize_item_ids": [
"T1",
"T2"
]
},
{
"plan_step_summary": "Step 2: Add Timeline with persisted-vs-render validation",
"finalize_item_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 3: Add runtime clip classification",
"finalize_item_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 4: Implement transient render view and update render executor serialization",
"finalize_item_ids": [
"T5",
"T6"
]
},
{
"plan_step_summary": "Step 5: Migrate Hype artifact consumers in executor paths",
"finalize_item_ids": [
"T6",
"T7"
]
},
{
"plan_step_summary": "Step 6: Update tests for Phase 2 behavior",
"finalize_item_ids": [
"T8"
]
},
{
"plan_step_summary": "Step 7: Validate broadly and commit",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Execution order 1: Stash user work before touching files",
"finalize_item_ids": [
"T1"
]
},
{
"plan_step_summary": "Execution order 2: Add Timeline with persisted-vs-render validation first",
"finalize_item_ids": [
"T3"
]
},
{
"plan_step_summary": "Execution order 3: Add tests for unknown fields, missing theme, transient render theme, and classification",
"finalize_item_ids": [
"T8"
]
},
{
"plan_step_summary": "Execution order 4: Migrate timeline and paired Hype artifact reads after class behavior is proven",
"finalize_item_ids": [
"T6",
"T7",
"T8"
]
},
{
"plan_step_summary": "Execution order 5: Run grep-based checks before broad tests",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Execution order 6: Push Timeline commits, then restore user uncommitted work",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 1: Run pytest tests/test_timeline_roundtrip_fixture.py -q",
"finalize_item_ids": [
"T2",
"T9"
]
},
{
"plan_step_summary": "Validation order 2: Run focused Timeline and executor tests around render, validate, refine, cut, and publish serialization",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 3: Grep for direct JSON loads of named Hype artifacts in executor code paths",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 4: Run broad suite with documented exclusions",
"finalize_item_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation order 5: Run CLI list checks and hype dry-run smoke",
"finalize_item_ids": [
"T2",
"T9"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All approved main phase, execution order, and validation order steps are mapped. No human-only actions are required because the executor has writable repo access and the requested push/restore/test work is operational repo work, not an out-of-band human dependency. The only deliberate adjustment is to address FLAG-003 by running the non-smoke cut resume tests where feasible instead of ignoring the entire file.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Expected baseline includes the current xfail for unknown top-level Timeline field preservation before implementation; after Phase 2 the xfail marker must be removed and the test must pass unconditionally."
}
code
Debt watch items (do not make these worse):
None.
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T6]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC6]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/ArtAgents/.megaplan/plans/phase-2-introduce-timeline-20260503-0039/execution_batch_5.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.