#1038 Add the read-only git adapter for worktree and base-branch ground truth - #1059
Merged
Conversation
The lane fold retains each session's working directory from its latest event, and `resolveLaneCwd` exposes the lane's worktree path — the repository location server-side adapters probe.
`FLEET_GIT_POLL_MS` sets how often the git adapter polls lane worktrees; default 15000, with empty or non-numeric values falling back to the default.
The server polls each lane's worktree with read-only git commands, observing the checked-out branch, the count of working-tree changes, and ahead/behind against the base branch. A missing worktree, a non-repository directory, or a failing command degrades that lane's observation rather than the poll pass, and the adapter never fetches or otherwise mutates a repository.
Each lane on the lanes snapshot and SSE stream carries a git block — checked-out branch, working-tree change count, ahead/behind, and the base ref compared against — null until the lane has been probed. A probe reporting the worktree gone closes the lane as worktree-gone.
The running server polls every lane that names a worktree and publishes git changes through the same diff gate as event changes, so working-tree state, base-branch advance, and a vanished worktree reach clients within one poll interval without a new event on disk.
The README describes what the git adapter surfaces on each lane, its read-only trust model, and the `FLEET_GIT_POLL_MS` configuration variable.
The probe tests spawn real git processes against temp repositories and could exceed the default test timeout under full-monorepo parallel load.
The composite key that indexes lanes across the store, the git adapter's targets, and the snapshot's observation lookup now has one definition, so the format cannot drift between its producer and consumers.
Dependency auditProduction dependency audit passed. |
williamthorsen
marked this pull request as ready for review
July 20, 2026 00:29
williamthorsen
added a commit
that referenced
this pull request
Aug 4, 2026
…e-v0.2.2 codeassembly-v0.4.0 factory-v0.2.2 codeassembly-mcp-v0.2.2 codeassembly-v0.4.0 - #1153 feat: Make codeassembly and kb CLI tools publishable (#1164) - #1091 fix: Anchor a project-deployed link where its target deploys (#1159) - #1156 refactor: Rename packages to publishable names (#1157) - #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155) - #1110 tooling: Migrate Vitest to nmr's centralized model (#1154) - refactor: Refine typescript-preferences - #1150 fix: State doc-description form and make comment mood opt-in (#1151) - deps: Upgrade first-party linting deps to latest version - #1137 feat: Establish personal rulebooks for code layout and TypeScript preferences (#1144) - #1126 feat: Check a package's own guidance content before it ships (#1138) - refactor: Fix lint - tooling: Remove redundant lint rules - #1133 fix: Reject an anchor link that names no heading (#1135) - #1122 feat: Capture lede decisions as an accumulating corpus (#1132) - #1125 feat: Honor invocation tokens in rulebook bodies (#1129) - #1107 feat: Render rulebook links and path tokens per harness (#1124) - #1115 feat: Sync guidance at build and install so an upgrade cannot leave it stale (#1123) - #1114 feat: Adopt a dependency's guidance by naming the package (#1121) - #1088 feat: Deliver project ambient rulebooks per harness (#1113) - #1087 refactor: Rename the authoring rulebook and mark its enforced rules (#1092) - #1095 tooling: Move compilation out of the install lifecycle into a bootstrap step (#1102) - #1094 refactor: Remove the ambient ripgrep dependency from the test suite (#1097) - deps: Upgrade all deps to latest version - tooling: Upgrade all deps to latest version & modernize configs - refactor: Fix lint - #1077 feat: Show the proposed edit above post-review menu options (#1078) - #1068 feat: Deliver ambient rulebooks mechanically, retiring GLOBAL.md (#1075) - #1069 feat: Add a no-second-person rule to the lede-voice doctrine (#1070) - #1050 feat: Add a redundancy rule to the lede-voice doctrine (#1058) - #1035 internal: Add lifecycle workspace with the canonical envelope, vocabulary & lane fold (#1049) - #1006 internal: Extend lifecycle-event instrumentation to five high-traffic skills (#1034) - #1028 feat: Rule out absence-of-removed-code tests (#1032) - #114 feat: Let reviewers emit gated insights into review artifacts (#1031) - #1027 internal: Retire input.received and redundant skill.progress emits (#1030) - #1026 fix: Name the side effects an approval ask authorizes (#1029) - #1022 fix: Normalize action and question label identifiers across asks blocks (#1025) factory-v0.2.2 - #1156 refactor: Rename packages to publishable names (#1157) - deps: Upgrade all deps to latest version - #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155) - #1110 tooling: Migrate Vitest to nmr's centralized model (#1154) - tooling: Remove redundant lint rules - deps: Upgrade deps to latest version - deps: Upgrade all deps to latest version - deps: Upgrade all deps to latest version - tooling: Upgrade all deps to latest version & modernize configs - refactor: Fix lint - deps: Upgrade all deps to latest version kb-v0.3.0 - #1153 feat: Make codeassembly and kb CLI tools publishable (#1164) - #1156 refactor: Rename packages to publishable names (#1157) - #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155) - #1110 tooling: Migrate Vitest to nmr's centralized model (#1154) - tooling: Remove redundant lint rules - #1095 tooling: Move compilation out of the install lifecycle into a bootstrap step (#1102) - tooling: Upgrade all deps to latest version & modernize configs - refactor: Fix lint codeassembly-lifecycle-v0.2.0 - #1153 feat: Make codeassembly and kb CLI tools publishable (#1164) - #1156 refactor: Rename packages to publishable names (#1157) - #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155) - #1110 tooling: Migrate Vitest to nmr's centralized model (#1154) - tooling: Remove redundant lint rules - #1095 tooling: Move compilation out of the install lifecycle into a bootstrap step (#1102) - tooling: Upgrade all deps to latest version & modernize configs - #1038 feat: Add the read-only git adapter for worktree and base-branch ground truth (#1059) - #1051 feat: Bound fold memory and rescan cost with a retention window (#1057) - #1035 internal: Add lifecycle workspace with the canonical envelope, vocabulary & lane fold (#1049) codeassembly-mcp-v0.2.2 - deps: Upgrade all deps to latest version - #1156 refactor: Rename packages to publishable names (#1157) - #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155) - #1110 tooling: Migrate Vitest to nmr's centralized model (#1154) - #1095 tooling: Move compilation out of the install lifecycle into a bootstrap step (#1102) - tooling: Upgrade all deps to latest version & modernize configs - refactor: Fix lint codeassembly-run-core-v0.2.2 - #1156 refactor: Rename packages to publishable names (#1157) - #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155) - #1110 tooling: Migrate Vitest to nmr's centralized model (#1154) - #1095 tooling: Move compilation out of the install lifecycle into a bootstrap step (#1102) - tooling: Upgrade all deps to latest version & modernize configs - refactor: Fix lint
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.
What
Fleet's lane view now reflects each worktree's real git state (the checked-out branch, the number of uncommitted files, and how far ahead or behind the base branch it sits), refreshed on a configurable interval. A lane whose worktree has been deleted now closes on its own, instead of lingering indefinitely.
Why
Fleet's lane state derived entirely from emitted lifecycle events, leaving the working tree itself invisible: uncommitted changes and base-branch advance had no ground truth. And a session that ended abnormally, with no
session.endedhook, kept its lane open indefinitely even after its worktree was gone.Details
🎉 Features
gitblock on the lanes snapshot and SSE stream: checked-out branch, working-tree change count, ahead/behind against the base branch, and the base ref compared against,nulluntil the lane has been probed. It never fetches or mutates a repository; base-branch advance is read from the local remote-tracking ref that worktrees share.worktree-gone, the backstop for a session that ended without asession.endedevent.resolveLaneCwdexposes the lane's worktree path for the adapter to probe.FLEET_GIT_POLL_MS(default 15000 ms) sets the poll interval.♻️ Refactoring
{repo}/{branch}) that indexes lanes across the store, the adapter's targets, and the snapshot lookup now resolves through onebuildLaneKeyhelper, so the format cannot drift between its producer and consumers.🧪 Tests
Closes #1038