BuildJournal: one typed home for the run's working memory#48
Merged
czpython merged 3 commits intoJul 21, 2026
Conversation
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
force-pushed
the
commonzenpython/eng-726-build-buildjournal-one-typed-home-for-the-runs-working
branch
from
July 20, 2026 15:29
86d4489 to
a454c53
Compare
czpython
marked this pull request as ready for review
July 20, 2026 15:29
czpython
deleted the
commonzenpython/eng-726-build-buildjournal-one-typed-home-for-the-runs-working
branch
July 21, 2026 20:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
backend/druks/build/journal.py— build-local, deliberately NOT an SDK primitive:PlanRecord(a plan plus the reviews of that draft) andBuildJournal(plans, implementations, evaluations — the list_implementation_reviewsmisnamed — and human_feedback), with the replay contract stated on the class. Eachadd_*returns its argument so call sites chain around the agent call.PlanRecordnesting kills the_reviews_at_planwatermark:reviewer_requirements()is just the filtered reviews ofplans[-1].self._journal. Pure-diary wrappers (generate_plan,review_plan,revise_contract,evaluate) dissolve into their phase call sites;implementandtriage_feedbackkeep their real control flow and only their diary writes move.BuildPromptContextdiets to identity facts and carries the journal; templates read it directly (build.current_plan→build.journal.plan.plan_markdown,build.implementation_reviews→build.journal.evaluations,build.reviewer_requirements→build.journal.reviewer_requirements(), revision counters →build.journal.*_revision, the SHA pair →build.journal.last_implementation.base_sha/head_shaunder one guard — the journal only ever holds successful deliveries, so the two per-field guards collapse). Safe becauseworkspace.already passes a live object, StrictUndefined fails loudly on a renamed projection, and the ImmutableSandboxedEnvironment keeps templates structurally read-only.build.acceptance_criteriawasn't on the ticket's retire list but was context-fed from the plan; it migrates the same way (build.journal.plan.acceptance_criteria).templates/prompts/build/for every retired name.Same note as #46 for repo-level prompt overrides of
_header.md: thebuild.<field>names above changed shape, and StrictUndefined fails loudly on a stale override.ENG-726