Define aha 0.2 Archive/Workspace lifecycle and compatibility boundaries - #16
Merged
Conversation
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
Define aha's complete 0.2 lifecycle and compatibility boundaries around one explicit authority flow:
This replaces the pre-launch command model, makes Archive/Workspace transitions construction-safe, bounds repeated download work, preserves repair identity outside SQLite, and versions config, Archive, HTTP, and MCP boundaries.
Why
The previous surface mixed transport (
depot), implementation (corpus), and combined-operation (refresh) concepts. A caller could not reliably infer:Because aha has no released users, retaining aliases would create permanent ambiguity without providing real compatibility. The lifecycle and rejection policy are specified in
docs/command-state-machine-v0.2-plan.md; storage and behaviour compatibility policy is indocs/compatibility-policy.md.How
Make authority and transitions explicit
archive,workspace,status,search,show,analyse failures,dashboard, andmcp check|servecommands.Construct capabilities before effects
Bound repeated work and preserve recovery
For
Mmachines,Cchanged machines, andF(C)files in their current manifests:O(M)and performs no manifest/blob fetch, lifecycle lock, or SQLite write;O(M + F(C));archive verify.Workspace repair builds and verifies a sibling, atomically exchanges it, and retains the previous Workspace. A checksummed
aha.workspace.identity.v1witness outside SQLite preserves the Archive binding even when the database is unreadable.Define compatibility boundaries
aha.config.v1, preserves JSONC comments, supports reverse-domain opaque extensions, and rejects unsupported schemas before mutation.upgrade_requiredrather than being opened for mutation./api/v2and advertisesaha.http.v2.aha.mcp.v2throughaha_capabilities; the generated TypeScript client uses the same 0.2 vocabulary.Keep interfaces and evidence aligned
aha.status.v2and linker-injectedversion --jsonbuild identity.Alternatives considered
synccommand: rejected because upload and download have independent partial outcomes and mutation targets.Testing
/api/statusreturning200, the config rewrite test lost nested extension comments, and unsupported Archive capabilities were initially accepted.make verify-fullpasses: unit/integration tests,go vet, race suite, bounded fuzzing, pinned TypeScript 5.9.3 typechecking/runtime tests, Linux/Darwin/Windows builds, and MCP SDK/code-mode conformance.b550e6b, publishes populated v2 history, then verifies, downloads, and searches it with current code; it also proves legacy writers cannot move v3 pointers.748af25.git diff --checkpasses.The optional Python FastMCP conformance leg was skipped because the Python
mcppackage is unavailable; the TypeScript and Go reference-server legs pass. The credentialed live R2 smoke suite was not run without its pinned external capability.Risk
This is intentionally a large, atomic pre-launch change: splitting command vocabulary, state authority, generated clients, and documentation would leave intermediate commits with contradictory public contracts.
Primary risks and mitigations:
aha-v3/, and the pinned N/N−1 executable journey proves both forward reading and reverse-direction write refusal.There is no visual UI change requiring screenshots; dashboard edits update versioned endpoint paths, and the HTML change updates architecture copy/metrics.
Review guide
internal/model/lifecycle.goandinternal/model/lifecycle_test.go— closed transition contract.internal/depot/depot_v2.goandinternal/depot/push_v2.go— capability construction, publication, and compatibility enforcement.internal/cli/command_archive.go— side-effect-free download planning and no-op path.internal/corpus/workspace_*.go— binding, vector, indexed lookup, identity witness, and repair state.internal/server/server.go,internal/mcp/tools.go, and generated TypeScript — versioned wire contracts.docs/command-state-machine-v0.2-plan.mdanddocs/compatibility-policy.md— product and compatibility decisions.