feat(core): batch checkpoints + source-unit-state, ontology-driven#32
Open
mroops0111 wants to merge 5 commits into
Open
feat(core): batch checkpoints + source-unit-state, ontology-driven#32mroops0111 wants to merge 5 commits into
mroops0111 wants to merge 5 commits into
Conversation
The sidebar previously only showed workspaces from the active server, forcing users to round-trip through Settings to see what was on other servers. Now every configured remote renders as its own section so the full inventory is visible in one glance and a single click switches both server and workspace. - api: rawFetch helper splits transport from singleton resolution so the new fetchJsonAt(remoteId, ...) can target any remote without disturbing the active one - useAllRemoteWorkspaces hook parallel-fetches /workspaces from every remote via useQueries; unauthenticated and unreachable states are surfaced so the sidebar can render Sign In / error affordances inline - useResetOnRemoteChange clears the react-query cache when the active remote flips so workspace-scoped queries don't return stale data from the previous server - Sidebar renders one section per remote with Notion-style heading (Laptop / Globe icon + name); clicking a workspace from a non-active remote silently switches active before navigating - ListRow gains stripeClassName / stripeDim so the row can advertise which remote it belongs to via a 2px left-edge bar that coexists with the active indicator - Details affordance moved from <button> to <span role="button"> to resolve a long-standing nested-button HTML validity warning Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
list() now skips unreadable rootPaths with a warn-level log so one ghost entry doesn't block boot. load() unchanged. Also drops the unused api.registerWorkspace shim in Studio whose server endpoint was removed earlier. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`SourceUnitState` records what extract has observed per source unit;
framework-level entity, ontology-neutral, file-per-entity at
`artifacts/source-unit-state/<sourceId>/<path>.json`.
`OntologyPlugin.batch` binding declares the skills the framework
dispatches: `perUnit` (extract), `checkpoint` (between-units hook
with chunkSize + runAtEnd + extraEnv), `deriveUnits` (scan-mode
fallback). Framework owns lifecycle and chunk accounting; ontology
owns skill ids and env contracts. DDD wires braid-extract /
braid-model / braid-scan with labels "Extract" / "Model".
`BatchPlan.checkpointPhases` is the append-only record of every
checkpoint run plus the units it consumed; `BatchPlan.batchPolicy`
snapshots the ontology binding at start() so UI labels and
anticipated chunks survive resume and ontology config changes.
Other changes:
- Checkpoint proposals auto-apply alongside extracts when autoApply
is on (previously only extract proposals applied).
- `batch.archive` commits to git history (`batch-archive` kind).
- Subprocess auth: caller Bearer token forwarded via `BRAID_TOKEN`
env and `--auth-type bearer --auth-token '${BRAID_TOKEN}'` on the
openapi-mcp-gateway, so claude can call the auth-gated REST API.
- `/openapi.json` public (industry convention; spec describes shape,
not data) and SSE endpoints accept `?token=...` because
EventSource cannot send custom headers.
- Studio Batch page restructured: per-group/checkpoint sections,
ontology-supplied action labels, unified `N/M` counter tone,
neutral badges to reduce visual noise.
Refactor: extract `enrichCommitAuthor`, `extractBearerToken`,
`runSkillWithAutoApply`, `aggregateUnitsTone` helpers; replace
`as XxxId` casts with `XxxId.parse(...)` in every touched file;
remove dead code.
Closes #27.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #27.
Summary
SourceUnitState: framework-level record of "what extract has observed per source unit". File-per-entity atartifacts/source-unit-state/<sourceId>/<path>.json.OntologyPlugin.batchbinding. Framework owns the batch lifecycle and chunk accounting; ontology declares which skills it dispatches at each step:perUnit(the extract step)checkpoint(between-units hook withchunkSize+runAtEnd+extraEnv)deriveUnits(fallback when the workspace has no intent source)BatchPlan.checkpointPhasesrecords every checkpoint run plus the units it consumed;BatchPlan.batchPolicysnapshots the ontology binding atstart()so UI labels / anticipated chunks survive resume and ontology config changes.autoApplyis on (previously only extract proposals applied).batch.archivecommits to git history asbatch-archiveso the audit trail stays continuous.BRAID_TOKENenv and--auth-type bearer --auth-token '${BRAID_TOKEN}'on the openapi-mcp-gateway, so spawned claude can call the auth-gated REST API./openapi.jsonis now public (industry convention) and SSE endpoints accept?token=...because EventSource cannot send custom headers.N/Mcounter tone, neutral badges to reduce visual noise.DDD ontology wires
braid-extract/braid-model/braid-scanwith labelsExtract/Model.