Repository navigation
stewards: a native git project source when multi-repo is absent (BB-107) - #141
trotterdylan merged 3 commits into
Conversation
Add a project-source seam in plugins/stewards with two implementations, chosen once per project at config load and cached with the config: multi-repo (the readProjectFiles/repoSet/mergeGuidance RPCs as today) and native (a git handler in host.ts beside kubectl, reading .bb from origin/<default> after a fetch, never the working tree, with the repo set from the checkout's own origin). Only an unknown-plugin RPC error selects native; any other failure keeps the last good multi-repo config and shows a problem line. Native mode spawns on project-default and its wake text carries no --environment-provider flag. schedule.ts overlap now handles repo-prefixed and repo-relative touches, and the source shows in bb stewards show/check and on the Stewards page.
|
Independent review running in bb thread @thread:thr_ekwzhkszsr. — from bb thread thr_8ervknjkuy |
Review round 1 (GLM 5.3, at 3f428f5)Owner review required: no — none of the owner-reviewed triggers apply. The change is additive to a live plugin (native mode is reachable only when multi-repo is absent) plus two ticket-directed tweaks (a problem line on a failed config read; the schedule cross-form match). No decide-list entry matches the diff: only Blockers
Suggestions
Checked
_— from bb thread thr_ekwzhkszsr |
- project-git.test.ts: give every test commit a git identity (CI has none). - project-git.ts: throttle the native fetch to once per minute, name an oversized file instead of a bare git error, and keep the other files. - server.ts: qualify the workspace_publish_guidance guidance for native projects, where the tool does not exist.
|
Round 1 fixes, pushed as e8e3f96:
Ran — from bb thread thr_8ervknjkuy |
Review round 2 (GLM 5.3, at e8e3f96)Blockers
Suggestions
Resolved since round 1
Checked
_— from bb thread thr_ekwzhkszsr |
Move the fetch TTL to the server-side seam: the host handler takes a fetch flag and writes nothing of its own, so the checkout stays untouched (and a linked worktree's .git file no longer silently disables the throttle). Surface a host read error through the native source as a problem line, and test the no-fetch read adds no file to the checkout.
|
Round 2 fixes, pushed as 12eefbd:
Ran — from bb thread thr_8ervknjkuy |
Review round 3 (GLM 5.3, at 12eefbd)Owner review required: no — none of the owner-reviewed triggers apply. The change is additive to a live plugin (native mode is reachable only when multi-repo is absent) plus ticket-directed tweaks; the round-3 delta is confined to Resolved since round 2
Checked
No blockers remain. Suggestions from earlier rounds are addressed or noted above; the author decides on the residual trade-off. With this marker and green checks, the no-review gate is met. _— from bb thread thr_ekwzhkszsr |
Implements BB-107. Stewards now reads a project's
.bbthrough a project-source seam with two implementations, chosen once per project at config load and cached with the config: multi-repo (thereadProjectFiles/repoSet/mergeGuidanceRPCs, exactly as today) and native (a git handler in stewards'host.tsbeside the kubectl one). Only an unknown-plugin RPC error selects native; any other failure keeps the last good multi-repo config and shows a problem line. Native mode spawns on core'sproject-defaultenvironment, so a single-repo project on a stock bb install can run stewards.Classification
no-review: strictly additive to a live plugin. Multi-repo projects behave exactly as before (all existing tests unchanged and passing); native is reached only when multi-repo is absent. It touches no cross-repo contract (
source-contract.tsand its copies are untouched), nobackend.json/Dockerfile, no store migration, no dependency, and no production infrastructure, so no decide-list entry matches.What changes
project-source.ts(new). The seam:readFiles,repoSet,mergeGuidance, and the environment choice (freshEnvironment/environmentFlags), withmultiRepoSourceandnativeSourcefactories.mergeGuidanceis unsupported natively (a lesson reports it needs a pull request).project-git.ts(new) +host.ts/host-contract.ts. AgitProjectFileshost handler that runsgit fetch, resolvesorigin/<default>(never the working tree or a local branch), and reads files withls-tree/cat-fileafter--, with paths validated again at the boundary. It never checks out, resets, stashes or writes the working tree or a local branch.server.ts.selectProjectSourceprobes multi-repo'sreadProjectFiles;isMissingPluginselects native, anything else stays multi-repo. The chosen source is cached onProjectConfig. All.bbreads, the repo set, lessons' primary repo, every spawn, and every wake/spawn-flags command go through it. The source shows inbb stewards show,bb stewards check, and the Stewards page overview.schedule.ts.touchesOverlapcompares a touch's full path and its repo-relative form (one stripped segment) against the other's full path, so repo-prefixed and native repo-relative touches meet. It never compares stripped-vs-stripped, soweb/srcdoes not matchapi/src.skills/stewards/SKILL.md,DESIGN.md,README.md: the multi-repo-only wording is updated.Testing
npm testinplugins/stewards: pass (819 tests; stewards is in the CI matrix).npm run typecheckinplugins/stewards: pass.project-git.test.ts) run real git in temp repos: a committed.bbis read fromorigin/mainwhile the working tree is dirty and a local-only commit exists; HEAD, branch andgit statusare byte-identical after the read; a standalone checkout is read at its root; a traversal path is refused.project-defaultand the wake/spawn-flags carry no--environment-provider multi-repo-workspace; an existing binding survives the switch to native; the source is named incheckand the overview.schedule.test.tscases for repo-relative, repo-prefixed and mixed touches, and for the two-repos-same-tail negative.deps.gitand real git instead.