Repository navigation
Add the ArchFlow MCP workflow server - #2
Merged
Merged
Conversation
Establish the exact-pinned Node package, foundational JSON Schema/Zod/YAML contracts, workflow and constitution assets, and canonical phase codecs. Add runnable bundle, dependency/license/notice verification, exact Node CI, and triaged counter-review fixes without entering later-phase MCP or persistence scope.
Freeze transport-neutral evidence, trust, gate, error, tool, and context contracts with strict JSON Schema/Zod agreement and identity-backed authority. Add exhaustive adversarial coverage and triage counter-review findings without entering MCP transport or persistence scope.
Admit the exact MCP beta roots and add the portable five-tool catalogue plus authenticated SDK-free handler boundary. Extend context, failure, and result validation with exhaustive schema/runtime agreement and tested Phase 3 boundary policy, including all accepted counter-review fixes without introducing transport or release artifacts.
Make simplicity, working behavior, maintainability, and proportional verification the default. Discourage speculative release, compliance, and abstraction machinery while preserving ArchFlow's human trust boundaries.
Implement the bounded low-level stdio runtime, SDK adapter, lifecycle and cancellation policy, output queue, and process runner with focused and live integration coverage. Pin the reviewed stable MCP SDK 2.0.0 public surface, record counter-review triage and implementation evidence, and complete the Phase 4 architecture state.
Builds and tracks the deterministic inert MCP bundle with canonical manifest, legal/risk evidence, and hostile-copy verification. Adds fresh-install reproduction and crash-recoverable dist promotion, with the accepted local-only fast-uri risk bound to immutable evidence.
The planned Phase 6 bundled two distinct bodies of work: the first filesystem and Git-subprocess layer in src/, and nine durable schemas. Three independent reviews found it did not fit one implementation session, so it is split at that seam. architecture.md now defines Phase 6 (Repository Identity, Paths, and Canonical Digests) and Phase 7 (Durable State and Artifact Schemas), with phases 7-19 renumbered to 8-20 and their dependencies rewired. REQ-33 is dropped from Phase 6, which no interface or chunk touched; it remains covered by phases 2, 3, 4, 5, 11, 12, 13, 18, 19. Phase 6 is DESIGNED at 10 chunks. Two sub-agent review rounds and one cross-client counter-review produced 18 findings, all accepted. The structural ones: the git runner is now root-bound at discovery, because an unrooted runner reports a missing attribute rather than an error when run from a subdirectory; every project error carries an operation context, because none was previously constructible from its own signature; raw Git paths get their own brand, because a conflicted file outside .archflow/ may legitimately carry a colon or non-NFC name; fingerprint collections are declared sets and sorted before hashing, because two callers could otherwise hash identical inputs differently; and the blanket "exit 128 means absent" rule is replaced by per-command declared absence, because git also returns 128 for dubious ownership and corrupt repositories. Phase 7 is DRAFT, not an approved design. It preserves the reviewed durable-schema material so it is not lost, but it has not passed a design gate, has not been counter-reviewed, and was written before Phase 6 exists, so every Phase 6 interface it references is provisional. Run archflow-phase-design mcp-integration 7 against Phase 6's implementation log before building it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9Dan3Gf3ztyovL2mXsu1
…gests Adds the first filesystem and Git-subprocess layer in src/: canonical JSON, SHA-256 and Git blob-OID primitives, branded ID and path-claim types with hardened lexical rules, a global retightening of task_id/intent_id/gate IDs across every Zod module and JSON Schema, a root-bound Git runner with caller-declared absence, worktree discovery and repository/task identity digests, two path resolvers over a seven-step containment sequence, -z attribute and index readers, porcelain-v2 history and conflict classification, and the fingerprint, config-pinning, and secret-scan contracts. No durable state, no mutation, no new dependency, no new error code. Implementation corrected three design errors: containment step 6 omitted a `rel !== ".."` guard and so accepted the root's own parent; --literal-pathspecs and :(top,literal) are mutually exclusive on git 2.43, so the flag is now prohibited rather than mandated; and --git-common-dir is relative to the process cwd, not the worktree toplevel. The mandated mechanical ID sweep found a fourth round of unlisted sites, where retightening review/triage/adjudication task_id is a vocabulary swap rather than a pure narrowing. Counter-review fixed a blocker where a getter could return one value to the exclusion walk and another to canonicalization, letting an excluded field reach a request digest, and closed a gap where path-unsafe IDs passed the ID schemas but failed path composition. check:release remains blocked: the tracked dist/ payload cannot be re-promoted after any bundle change, because committed decision records are byte-immutable against HEAD, every decision must bind the current bundle digest, and a supersession must retain the superseded decision carrying the old digest. The user re-accepted the fast-uri risk and release:stage passed; only promotion fails. Fixing Phase 5's integrity model is tracked as a follow-up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UvSQLKZFe1zaSgWHCQ9zKP
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UvSQLKZFe1zaSgWHCQ9zKP
Replace the unapproved Phase 7 DRAFT with a gate-approved design, reconciled against what Phase 6 actually shipped rather than what the combined Phase 6+7 design intended. The draft carried ten unverified Phase 6 assumptions, one of which did not compile: CanonicalDocument<T extends PlainJsonValue> cannot accept an interface, so the draft's "typed against the roots" device was unbuildable. Durable roots and every type transitively reachable from one are now type aliases; DeclaredInputRef and SecretFinding are converted. The frame-agreement rule was false -- three of the four repository path classes live under .archflow/ -- and template-based path classification is unreachable from src/contracts/ at all, so it is now a stated limitation owned by Phase 10. Two in-session review rounds and one cross-client counter-review produced 50 findings, all triaged and applied. Dispositions for the counter-review are recorded in its Triage section; all eleven were accepted. Split, approved at the design gate: the manual-checkpoint family moves to a new Phase 8, and Phases 8-20 renumber to 9-21. Two counter-review blockers moved with it -- the format could not prove initialization in either mode, and a digest-valid chain could cross task boundaries -- and are written into Phase 8's scope so its designer inherits them. EvidenceChainEntry had no remaining consumer and left with them, which also withdrew the trust.ts export edit. Phase 7 is now 13 chunks, 42 files, ~5,300-6,100 lines: durable-primitives, task-state, maintenance-record, both initialization authorities, document-artifact, implementation-output, one consolidated semantic validator with a pinned 23-row invariant table, and registry/barrel integration. Dependency currency verified live: every pin is at latest with no advisories. Zod 4.4.3's z.toJSONSchema() is recorded as evaluated and rejected -- it drops .refine() silently, which would erase the reserved-device-name, trailing-dot, NFC and set-ordering rules while assertZodAgreement still passed. Completed phase designs and past counter-reviews were not renumbered; a note under ## Phases records that pre-2026-07-28 documents use the old numbering. Status stays DESIGNED. No src/ or test/ changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X2DybfnY1stKK88efMzJjD
Define all seven persisted shapes as versioned normative JSON Schemas with Zod mirrors for the five reachable from the archflow_state.artifact union, plus one consolidated cross-document semantic authority (validateDurableSemantics). Structural authority is pushed as far as it goes — the 14-branch OutputEntry table, byte caps, git-object zero-byte accounting, and set ordering are unrepresentable when contradictory rather than merely rejected — leaving the validator only what genuinely spans documents. Registry 25 to 32 schemas; no new runtime dependency and no new error code. Cross-class rename verification and byte verification of payload_bytes/payload_digest/after.oid are deferred to Phase 10 and recorded as such. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0189BMYTpztPFZJpatsTgmKi
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0189BMYTpztPFZJpatsTgmKi
Define the manual checkpoint and import contracts, predecessor-linked chain selection, and consolidated semantic validation with exact state-to-checkpoint provenance. Add adversarial structural and semantic coverage, preserve durable descriptor safety, and document the approved recovery limitation and implementation deviations.
Add immutable intent receipts, closed request identities, authenticated task authority, task-local locking, and the mature-state transaction kernel with state-last commitment and exact replay. Verify durable precedence, all-tool selectors, multi-process races, and real SIGKILL crash recovery while retaining the inherited release-offline limitation.
Adds artifact-aware state identity, revision-0 initialization, lifecycle-checked checkpoint adoption, bounded reconciliation, explicit lock repair, and authenticated Git handoff recovery. Retained receipts remain state-authorized, recovery observations are capability-bound, and real-process crash plus real-Git fixtures cover the new authority seams. The inherited release-integrity contradiction remains unchanged.
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.
Summary
Validation