Repository navigation
factory: the facts the desktop needs on the wire (lane W) - #2481
Merged
Merged
Conversation
job.source/repo_url/route, one step count (steps_done/steps_total), runs_on from the one model chain (which now reaches the person's worker model before the launch default), entry.author on transcript entries, no machinery in suggested replies, and a step scratch folder outside the checkout with repository copies kept out of the change and the commit.
…lde page answers "start with ~"
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.
Lane W of the general-factory wave: the facts the new desktop UI reads, each computed once in
internal/factoryand sent. The desktop never re-derives them. Spec:docs/design/factory-general-ui/DESIGN.md§0 in codeaf-desk #279.Wire (additive; every field is ignored by older clients)
job.source{name, ref?, url?}:github+owner/repo#N+ issue URL,jira+ENG-142,inbox:ops+A1,terminal/chatfactory.job_sourcejob.repo_urlhttps://github.com/<owner>/<name>; absent withoutowner/namefactory.job_sourcejob.route{rule, answer?: {yes, why, model?}}fromItem.Route/Item.Judged[rule]factory.job_sourcejob.steps_done/job.steps_totalfactory.StepCountfactory.job_stepsjob.runs_on,step.runs_on{model, from},from∈step, job, one_model, effort, factory, worker, runner; set on reads onlyfactory.job_runs_onentry.authorperson|engine|agenton transcript entriesagents.entry_authordesk.source_refItem.SourceRef, for the client seam's round tripThe existing
job.modelkeeps its meaning (the person's pick for the job), so it is not repurposed.runs_onis never set byFromItem, which keeps it out of worker reports: an older factory rejects unknown fields.The one step count
There were three counts.
briefProgresscounted run phases (skipped ones included),job.step.countwaslen(Phases), and the desktop counted its own rail rows.factory.StepCountreplaces all three: run phases minus skipped ones, plus switched-on steps the run has not reached yet. The Brief and the wire both call it.Model resolution fix
cfg.Model. For a profile with no typed model,cfg.Modelisconfig.ChatDefaultAt=config.DefaultModel. The chain was also split acrossfactoryStepModelandstageOpenModel.factory.StepModel: step pick → job pick → one model → effort → factory default (the queued one, else the current one) → the person's worker seat (config.TierSeatAt(profile, worker), pinned or routed) → the runner's launch model.factoryOpenModel), the queue'smodel(defaultModel) and the wire'sruns_on(serve.Config.RunnerModels). What the page shows is what runs.Chat authorship and suggestions
appEntryAuthorsetsauthorfrom the producer's marks, not from the text: user lines areperson, except[carry on]lines (session.IsCarryOn), which areengine. Runner progress lines, notes and summaries areengine; answers and tools areagent.appMarkStepBriefmarks a step chat's first message (the brief the maker submits on Open) asengine, using the owner record beside the journal.session.cleanReplySuggestiondrops a draft that opens with[carry on]or names a belt tool with an underscore (stage_resultis always included). It is filtered where drafts are made.Proof scratch (PR #148 root cause)
.proof-prefix-NNNN. The proof step's model needed a second copy of the repo and had nowhere outside the checkout to put it.readChangecounts every untracked file andcommitApprovedrunsgit add -A, so the copy became part of the change, tripped the protected-path approval and was committed.run.ScratchDir(worktree)under the OS temp dir. It is made before the step opens, named in the brief ("everything left in the checkout is published") and removed on Discard.repoCopiesfinds a new top-level folder that mirrors the repo's tracked files. It must be hidden or copy at least half the repo.readChangeleaves it out.commitApprovedexcludes it from the add and runsgit rm --cachedon a copy a step already committed. The folder stays on disk.Also
inbox.Splitnow delegates tofactory.SourceKey(the same rule, in one place).TestEveryFieldRoundTripswas red on the base, failing onSourceRef,RouteandJudged. It is green now:Item.Judgedis named inLost(only the deciding rule's answer crosses).The lanes manual heading gains "why does this model start with ~": the new factory text shifted retrieval for that probe.
Proof
make test-laws: green.make test-focus PKGS='./internal/factory/... ./internal/appwire' RUN=.: 24 packages ok.TestReportGoroutineEndsWithoutLosingSpendfailed once whiletest-lawswas running alongside, then passed with-count=3alone. The same run before rebasing hit failures already fixed by 106097c.cmd/codeaf:RUN='Entr|Transcript|StepStream|StepChat|Stage|Factory.*Model|Effort|Suggest|Hello|Feature'ok.internal/session: the threeTestReplySuggestion*tests only.TestStepCountIsTheOneCountTheBriefReadsToo,TestStepModelTriesEachRungInOrder,TestNextModelStageIsTheCurrentOrNextConversation,TestJobSourceAndRepoURLTestAJobCarriesItsSourceRouteAndStepCount,TestRunsOnSaysTheOneResolutionOnReadsOnlyTestAStepWithNoFactoryDefaultRunsOnThePersonsWorkerModelTestATranscriptEntrySaysWhoWroteIt,TestReplySuggestionNeverOffersWordsAddressedToTheModelTestAProofRunLeavesNoExtraFilesInTheDiff,TestACommittedCopyIsTakenOutAndANewPackageStaysDocs:
docs/design/app-v3/PROTOCOL.md("Factory job facts", "Transcript entry author"); manualfactory.mdandfactory-stage-conversations.md(the model a step runs on).🤖 Generated with Claude Code