Skip to content

BuildJournal: one typed home for the run's working memory#48

Merged
czpython merged 3 commits into
mainfrom
commonzenpython/eng-726-build-buildjournal-one-typed-home-for-the-runs-working
Jul 21, 2026
Merged

BuildJournal: one typed home for the run's working memory#48
czpython merged 3 commits into
mainfrom
commonzenpython/eng-726-build-buildjournal-one-typed-home-for-the-runs-working

Conversation

@czpython

@czpython czpython commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Was stacked on #46; rebased onto main after it landed.

BuildWorkflow's replay-rebuilt working state sprawled as five parallel lists plus a watermark int, with its projections living as workflow methods and the replay contract existing as one comment. The pattern is sound (Temporal holds workflow state exactly this way); the sprawl and the invisible contract were the problems.

  • New backend/druks/build/journal.py — build-local, deliberately NOT an SDK primitive: PlanRecord (a plan plus the reviews of that draft) and BuildJournal (plans, implementations, evaluations — the list _implementation_reviews misnamed — and human_feedback), with the replay contract stated on the class. Each add_* returns its argument so call sites chain around the agent call. PlanRecord nesting kills the _reviews_at_plan watermark: reviewer_requirements() is just the filtered reviews of plans[-1].
  • The workflow keeps one attr, self._journal. Pure-diary wrappers (generate_plan, review_plan, revise_contract, evaluate) dissolve into their phase call sites; implement and triage_feedback keep their real control flow and only their diary writes move.
  • BuildPromptContext diets to identity facts and carries the journal; templates read it directly (build.current_planbuild.journal.plan.plan_markdown, build.implementation_reviewsbuild.journal.evaluations, build.reviewer_requirementsbuild.journal.reviewer_requirements(), revision counters → build.journal.*_revision, the SHA pair → build.journal.last_implementation.base_sha/head_sha under one guard — the journal only ever holds successful deliveries, so the two per-field guards collapse). Safe because workspace. already passes a live object, StrictUndefined fails loudly on a renamed projection, and the ImmutableSandboxedEnvironment keeps templates structurally read-only.
  • build.acceptance_criteria wasn't on the ticket's retire list but was context-fed from the plan; it migrates the same way (build.journal.plan.acceptance_criteria).
  • Verified zero stale refs across templates/prompts/build/ for every retired name.

Same note as #46 for repo-level prompt overrides of _header.md: the build.<field> names above changed shape, and StrictUndefined fails loudly on a stale override.

ENG-726

@czpython
czpython changed the base branch from main to commonzenpython/eng-725-build-stop-smuggling-per-call-agent-arguments-through July 20, 2026 15:08
Base automatically changed from commonzenpython/eng-725-build-stop-smuggling-per-call-agent-arguments-through to main July 20, 2026 15:20
@czpython
czpython force-pushed the commonzenpython/eng-726-build-buildjournal-one-typed-home-for-the-runs-working branch from 86d4489 to a454c53 Compare July 20, 2026 15:29
@czpython
czpython marked this pull request as ready for review July 20, 2026 15:29
@czpython
czpython merged commit 2ab0f4a into main Jul 21, 2026
1 check failed
@czpython
czpython deleted the commonzenpython/eng-726-build-buildjournal-one-typed-home-for-the-runs-working branch July 21, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant