← Back to file list
Build Log
The running implementation log for what changed and why.
Active Run · /home/jonas/social-carousel-codex/docs/build-log.md
Last modified: 2026-03-29T12:57:49.444Z
# Build Log ## 2026-03-29 - Read the Phase 2 workflow docs and the live OpenClaw reference files before implementation. - Scaffolded `apps/carousel-web/` by selectively copying stable preview-app pieces from the live app: - frozen `fact` contract files - schema and contract helpers - slide viewer components - preview page and API route skeleton - Reworked app storage to use repo-local preview artifacts only under `artifacts/previews/`. - Split the new app onto the Codex-owned route shape: - `POST /api/preview/generate` - `GET /preview/[folderName]` - Set the new app to local port `3101`. - Implemented `scripts/runtime_state.py` for atomic ledger writes, immutable checkpoints, append-only logs, preview materialization, preview verification, parked runs, and DLQ writes. - Implemented `scripts/run_local_dry_run.py` as the fixture-driven proof path for intake through preview verification. - Added Phase 3 fixtures under `fixtures/phase3/`. - Updated repo guidance in `AGENTS.md`, `state/README.md`, `apps/carousel-web/README.md`, `README.md`, and `docs/README.md`. - Added Phase 3 operational docs: - `docs/state-schema.md` - `docs/local-run.md` - `docs/phase3-handoff.md` - Verified the dry run with `python3 scripts/run_local_dry_run.py`. - Installed local preview-app dependencies with `cd apps/carousel-web && npm install`. - Verified the preview app compiles with `cd apps/carousel-web && npm run build`. - Noted one `npm install` advisory summary: `1 high severity vulnerability`. - Added the repo-local main skill at `.codex/skills/carousel-workflow/` to encode the one-thread intake-to-preview business workflow. - Added the supporting research skill at `.codex/skills/carousel-literature-review/` to reuse the OpenClaw literature-review capability without making it the workflow owner. - Added Phase 5 operational docs: - `docs/main-skill-design.md` - `docs/literature-review-integration.md` - `docs/phase5-handoff.md` - Updated `AGENTS.md` to register the new repo-local skills as runtime entry points above the deterministic execution layer. - Added a minimal whitelist-backed web docs editor inside `apps/carousel-web/` with: - `/editor` - `/editor/[slug]` - load/save API routes under `/api/editor/files` - atomic save with timestamped backups under `artifacts/editor-backups/` - Added editor docs: - `docs/web-docs-editor.md` - `docs/phase-docs-editor-handoff.md` - Extended `scripts/runtime_state.py` with deterministic Phase 6 workflow helpers for: - intake persistence - angle-set persistence - explicit angle approval - research summary persistence - research lock approval persistence - canonical draft commit - deterministic QC - verified preview binding - revision classification - final approval - Added durable Phase 6 state artifacts: - `angle-approval.json` - `qc-result.json` - `revision-classification.json` - `final-approval.json` - Tightened the draft validation surface to enforce lineage-bearing fields before preview build. - Updated the main workflow skill and supporting literature-review skill so they point to the new helper commands instead of manual state mutation. - Added Phase 6 operator docs: - `docs/helper-surface.md` - `docs/qc-execution.md` - `docs/phase6-handoff.md` - Updated `docs/state-schema.md`, `docs/main-skill-design.md`, `docs/literature-review-integration.md`, `docs/README.md`, and `AGENTS.md` for the new helper layer. - Verified a helper-driven happy path on `IDEA-local-phase6-helpers` from intake through final approval. - Verified a blocked QC path on `IDEA-local-phase6-qc-fail`, including a persisted `qc-result.json`, incremented validation retry counter, and blocked ledger state. - Added `scripts/literature_review_wrapper.py` as a repo-local adapter around the OpenClaw literature-review search script. - Added `artifacts/research/` as the home for raw literature-search output, transformed helper inputs, and wrapper result summaries. - Added a committed raw-results fixture at `fixtures/phase7/raw-search-results.json` for deterministic research-package runs. - Extended `verify-preview` to: - validate `carousel.json` as a preview payload - check manifest consistency - perform bounded HTTP verification against `/preview/<folder_name>` and `/api/preview/<folder_name>` - optionally verify the public host through `--public-base-url` - Bumped preview verification records to `phase7-preview-verification.v2`. - Rewrote `scripts/run_local_dry_run.py` around the real helper commands and wrapper path, including: - a happy path on `IDEA-local-phase7-dry-run` - a blocked QC-fail path on `IDEA-local-phase7-dry-run-qc-fail` - Added Phase 7 docs: - `docs/literature-review-wrapper.md` - `docs/preview-verification.md` - `docs/dry-run-flow.md` - `docs/phase7-handoff.md` - Updated skill references and operator docs so they point to the wrapper and stronger preview verifier instead of the older documented gap. - Verified fixture-backed wrapper persistence on `IDEA-local-phase7-wrapper`. - Verified live-search wrapper persistence on `IDEA-local-phase7-wrapper-live`. - Verified stronger local preview verification on `idea-local-phase6-helpers`. - Verified stronger local plus public preview verification on `idea-local-phase6-helpers`. - Started Phase 8 with the first supervised real run on `IDEA-20260329-protein-breakfast-satiety-realrun-01`. - Persisted the real-run intake with `record-intake`. - Persisted exactly three angle options with `record-angle-set`. - Revised the selected angle to a more practical framing and persisted explicit angle approval with `approve-angle`. - Added `--summary-only` to `scripts/literature_review_wrapper.py` so supervised runs can stop at research approval instead of auto-writing `research-lock.json`. - Ran the live literature-review search path for the Phase 8 idea, captured successful raw results, and persisted the real research summary with the wrapper in `--summary-only` mode. - Hit one live PubMed `HTTP 429` on a repeated query variant and documented the rate-limit friction instead of silently retrying indefinitely. - Persisted a conservative research lock with one explicit allowed claim, explicit forbidden inferences, and the trial protocol kept out of the primary support chain. - Committed canonical draft `V1` for the real run using only the primary support citations `S1` and `S3`. - Passed deterministic QC for the real run. - Built and materialized the real preview payload under `artifacts/previews/idea-20260329-protein-breakfast-satiety-realrun-01/`. - Verified the preview locally and publicly on `https://agent.jonaswilbert.com`. - Bound the verified preview back into the ledger and stopped at `stage: preview_pending_decision`. - Exposed one helper-surface sequencing gap during the real run: `commit-draft` can still be launched out of order relative to research approval, so the run required one idempotent replay to restore the correct stage. - Exposed one preview-surface gap during the real run: the ledger still stores the local preview URL even when public verification succeeds. - Classified the first revision request as `copy_within_lock`. - Committed revised draft `V2` with a shorter cover and four consumer-facing content slides while keeping the same research lock. - Reran deterministic QC on `V2` and passed. - Rebuilt and reverified the public preview for `V2`. - Noted one additional preview-surface gap during the revision cycle: preview artifacts currently overwrite in place per idea because the preview folder is not version-specific. - Added Phase 8 operator docs: - `docs/real-run-notes.md` - `docs/phase8-handoff.md` - Parked `IDEA-20260329-protein-breakfast-satiety-realrun-01` intentionally to improve workflow quality while preserving all drafts, previews, checkpoints, and logs. - Hardened `park-idea` so it now writes a checkpoint and append-only event instead of only mutating the ledger. - Hardened `commit-draft` so it now requires an approved research lock and the correct draft-stage action before persisting a draft. - Hardened the runtime-side contract validator so it now enforces the highlighted cover-phrase length rule and related cover constraints that were already present in the app validator. - Verified the new runtime checks by: - confirming an invalid highlighted phrase fails deterministically - confirming a parked run can no longer accept an out-of-sequence `commit-draft` - Promoted approved workflow defaults into repo guidance: - concise covers - at least 4 content slides by default unless explicitly justified - standalone readable content slides - distinct points and logical story progression - default `copy_within_lock` handling for this class of revision feedback - Added an approval-gated reusable-rule flow centered on `docs/rule-candidates.md`. - Added workflow-hardening docs: - `docs/rule-candidates.md` - `docs/phase-workflow-hardening-handoff.md` - Updated `docs/workflow-spec.md`, `docs/main-skill-design.md`, `docs/qc-execution.md`, `docs/helper-surface.md`, `AGENTS.md`, and `.codex/skills/carousel-workflow/SKILL.md` to reflect the approved workflow defaults and the clearer character-limit/QC enforcement path. - Approved and implemented all three pending rule candidates from `docs/rule-candidates.md`. - Changed `build-preview-payload` to derive version-specific preview folders from `<idea_id>-<draft_version>`, so new preview revisions no longer overwrite older preview bundles in place. - Kept older per-idea preview folders readable and verifiable as a forward-only migration path. - Bumped preview verification records to `phase8-preview-verification.v3`. - Changed `verify-preview` so top-level `viewer_url` and `api_url` now prefer the public verified host when `--public-base-url` succeeds, while still preserving artifact-local URLs separately. - Verified the new preview behavior by materializing and verifying `idea-20260329-protein-breakfast-satiety-realrun-01-v2` on both `127.0.0.1:3101` and `https://agent.jonaswilbert.com`. - Changed `scripts/literature_review_wrapper.py` so `--summary-only` no longer requires `approved_at`. - Replaced the old pre-approval `research-lock-input.json` artifact pattern with: - `research-lock-proposal.json` - optional `research-lock-approval-input.json` - Verified the new approval-gated wrapper behavior on `IDEA-local-approved-rules-wrapper`, including a proposal artifact with no `approved_at`. - Updated the main workflow skill, execution-layer reference, and operator docs to reflect: - version-specific preview artifacts - public-url preference after successful public verification - separate pre-approval research-lock proposals - Added `docs/phase-approved-rules-handoff.md` as the implementation handoff for the approved rule-candidate pass. - Trimmed the web docs editor down to a smaller set of high-value Markdown and skill files instead of showing every likely-unimportant handoff and infrastructure note. - Grouped the editor index into: - active run - workflow rules - agent behavior - design reference - Added short descriptions for both editor categories and individual files. - Added a simple filesystem-backed `/list` page that reads active runs from `state/ideas/`, paginates 20 posts per page, links to previews, and supports soft delete. - Implemented delete as an archive move into `state/deleted/` instead of a hard unlink so runs can be removed from the active list without destroying traceability immediately. - Completed the previously unfinished operator-usability and version-traceability hardening pass. - Exposed `approve-research-proposal` on the real CLI so a reviewed `research-lock-proposal.json` can now be promoted into `research-lock.json` without hand-authoring approval JSON. - Added lightweight read-only operator commands: - `show-current-run-state` - `show-angle-options` - `show-research-package` - `show-latest-preview` - `show-version-history` - Formalized the dual history model where: - `qc-result.json` and `preview.json` remain latest pointers for compatibility - `qc-results/<version>.json` and `preview-records/<version>.json` are the explicit per-version history - Updated skill guidance and execution-layer docs so approval-gated research now points to `approve-research-proposal` instead of implying manual approval-payload shaping. - Added Phase docs for this pass: - `docs/operator-commands.md` - `docs/version-history.md` - `docs/phase-next-hardening-handoff.md` - Started Phase 9 with a fresh second supervised real run on `IDEA-20260329-postmeal-walk-glucose-realrun-02`. - Persisted the new run intake with `record-intake`. - Used `show-current-run-state` immediately after intake to confirm the new run state before generating angles. - Persisted exactly three angle options with `record-angle-set`. - Used `show-current-run-state`, `show-angle-options`, and `show-version-history` to surface the first approval gate cleanly with the improved helper surface. - Persisted explicit angle approval for option `1` on the Phase 9 run with `approve-angle`. - Ran the literature-review wrapper in `--summary-only` mode for the approved angle and moved the run to `research_pending_approval`. - Used `show-research-package` to surface the research approval gate cleanly. - Rejected the first live-query source mix internally before approval, then reran the wrapper with a stronger query and a new research bundle while preserving the first unapproved bundle for traceability. - Approved the final research package for the Phase 9 run with `approve-research-proposal`. - Committed canonical draft `V1` for the Phase 9 run under the approved research lock. - Verified the new per-version traceability model in a real supervised run: - `qc-results/V1.json` - `preview-records/V1.json` - Passed deterministic QC on `V1`. - Built, materialized, verified, and recorded the Phase 9 preview on both the local app and the public host. - Confirmed the public preview URL is now the preferred recorded review URL for the Phase 9 run. - Stopped the run at `stage: preview_pending_decision` and updated `docs/real-run-notes.md` plus `docs/phase9-handoff.md` instead of advancing past the required human gate. - Classified the next Phase 9 revision request as `copy_within_lock` because it asked for stronger social-media copy and clearer slide roles without expanding beyond the approved research lock. - Committed revised draft `V2` for the Phase 9 run with: - a stronger curiosity-driven cover - four more distinct editorial content slides - the same approved evidence boundary and source set - Reran deterministic QC on `V2` and passed. - Built, materialized, verified, and recorded the versioned `V2` preview on both the local app and the public host. - Confirmed the per-version history model now shows: - `drafts/V1.json` - `drafts/V2.json` - `qc-results/V1.json` - `qc-results/V2.json` - `preview-records/V1.json` - `preview-records/V2.json` - Captured four new proposed reusable rule candidates from the Phase 9 revision cycle in `docs/rule-candidates.md`: - stronger curiosity-led covers can stay within lock if later slides carry the nuance - each content slide should have a distinct editorial role - the carousel should tell a logical story instead of repeating one point - evidence caveats should be translated into natural consumer language - Approved the current verified `V2` preview as the accepted version for `IDEA-20260329-postmeal-walk-glucose-realrun-02`. - Bound final approval to the verified `V2` preview with `final-approve` and marked the run complete while preserving all draft, QC, preview, checkpoint, and log history. - Promoted `RC-20260329-004` through `RC-20260329-007` into durable workflow defaults across: - `AGENTS.md` - `.codex/skills/carousel-workflow/SKILL.md` - `docs/workflow-spec.md` - `docs/main-skill-design.md` - `docs/qc-execution.md` - `docs/helper-surface.md` - Updated `docs/rule-candidates.md`, `docs/phase9-handoff.md`, and `docs/real-run-notes.md` so the second supervised real run now records a clean complete state rather than a pending preview gate. - Added Phase 10 benchmark-first helper support in `scripts/runtime_state.py`: - richer benchmark-aware `record-intake` - `record-benchmark-diagnosis` - `show-benchmark-diagnosis` - `generate-benchmark-angle-set` - Added benchmark-first run stages and durable artifacts: - `benchmark_analysis_pending` - `benchmark_diagnosed` - `state/ideas/<idea_id>/benchmark-diagnosis.json` - `artifacts/benchmarks/<idea_id>/benchmark-screenshot.<ext>` - Verified the new helper path locally on `IDEA-local-phase10-benchmark` from benchmark-first intake through generated angle-set and angle-pending-approval state. - Added benchmark-first operator UI routes in `apps/carousel-web/`: - `/start` - `/runs/[ideaId]` - `/rules` - Added helper-backed operator API routes for: - benchmark-first start - benchmark diagnosis persistence plus angle generation - angle approval - research approval - preview approval - benchmark screenshot serving - rule-candidate approval - Updated workflow guidance so the social-carousel workflow now defaults to: - benchmark screenshot plus short operator context when available - explicit benchmark diagnosis before angle generation - benchmark-as-inspiration rather than paraphrase - a concrete `10x better` definition - Added Phase 10 docs: - `docs/benchmark-intake.md` - `docs/operator-ui.md` - `docs/phase10-handoff.md` - Rebuilt and restarted the managed Next.js runtime after the Phase 10 app changes. - Verified the new benchmark-first operator routes return `200` locally: - `http://127.0.0.1:3101/start` - `http://127.0.0.1:3101/rules` - `http://127.0.0.1:3101/list` - `http://127.0.0.1:3101/runs/IDEA-local-phase10-benchmark` - Verified the new operator entry routes return `200` publicly through Caddy: - `https://agent.jonaswilbert.com/start` - `https://agent.jonaswilbert.com/rules` - Verified the real benchmark-first app start flow by POSTing a benchmark screenshot to: - `POST /api/operator/runs/start` - Confirmed the app-backed intake path creates: - `state/ideas/IDEA-20260329-benchmark-first-upload-verification-run-01/intake.json` - `artifacts/benchmarks/IDEA-20260329-benchmark-first-upload-verification-run-01/benchmark-screenshot.png` - Verified the new uploaded-run dashboard returns `200` locally and publicly: - `http://127.0.0.1:3101/runs/IDEA-20260329-benchmark-first-upload-verification-run-01` - `https://agent.jonaswilbert.com/runs/IDEA-20260329-benchmark-first-upload-verification-run-01`
Save
Ready