Architecture Overview#
ACKit is a single npm package (@cynrath/agent-context-kit) exposing:
- a CLI (
ackit) and - a read-only MCP server (official TypeScript SDK over stdio)
built from one modular TypeScript (strict, ESM) source tree.
Invariants#
- Single door to the filesystem — feature code never calls
fsdirectly. - Redaction before reporters — findings are constructed already-safe.
- Determinism — same repo+config ⇒ byte-identical JSON/packs/fingerprints.
- Offline by construction — resolution paths cannot reach the network.
- Single identity source — package.json feeds CLI/MCP/reports alike.
SDK as shared engine (v0.2.0, ADR-0021)#
src/index.ts is the frozen public SDK surface (contract-tested). CLI (src/cli/**), MCP (src/mcp/**), dashboard, GitHub Action, and VS Code extension all reuse scanRepository / buildContextPack / buildInstructionGraph / loadAckitConfig via this boundary. External consumers (npm install @cynrath/agent-context-kit → import { scanRepository }) use the same ESM import. src/core/** is internal; the distributed package.json exports exposes only "." and "./mcp".
Reserved subsystems (v0.2.0)#
The following modules are reserved for v0.2.0 and not yet implemented in this baseline:
src/core/readiness/— deterministic readiness scoring engine (scoreRepository)src/core/profiles/— provider-aware context profiles (Codex, Claude, Copilot, Gemini, generic)src/core/policy/packs/— declarative rule packs (YAML/JSON, collision handling, ReDoS-safe)src/core/dashboard/+src/dashboard/ui/— local localhost-only dashboard/report serversrc/core/diagnostics/— diagnostics and sanitized bundlebenchmarks/— performance benchmark fixtures/harness (deterministic, multiplier thresholds)extensions/vscode/— official VS Code extension (SDK consumer, VSIX)
No code exists for these subsystems in this baseline commit; they are documented here to pin architecture boundaries before implementation starts. See docs/v0.2.0/EXECUTION_PLAN.md and ADRs 0015–0024.
Details: docs/concepts/*.md, ADRs under docs/rebuild/decisions/ and docs/decisions/.
Workflow expansion architecture (ADR-0025 … 0028)#
New first-class primitives (additive; legacy repositories unaffected):
Existing subsystems are extended, never duplicated: task frontmatter gains
optional intentRef/specRefs/decisionRefs/planRef (schemaVersion stays 2);
buildContextPack gains task/resume ranking signals; the policy engine gains
optional autonomy (tier0–4 × allow/ask/deny) and review sections; skills gain
deterministic provider projections.
Terminology#
- Intent — committed, schema-versioned record of problem/desired
outcome/constraints/non-goals/acceptance criteria (
ackit.intent.v1). Required only by workflow profiles that declare it; never inferred by ACKit. - Workflow profile — explicit lifecycle contract selected per task:
quick,standard, orhigh-risk(ADR-0025). - Stage — one ordered step of a profile; forward-only, machine-checkable.
- Required artifact — a declared prerequisite (intent, spec, plan, task, evidence, verdict) that must exist before its stage advances.
- Evidence — typed, referenced proof linked to an acceptance criterion
(
ackit.evidence.v2). Implementation existing ≠ criterion verified. - Verdict — a fresh-context verifier’s structured judgment
(v1-authored, persisted as
ackit.verdict.v2bound verdicts): PASS / PASS_WITH_WARNINGS / REWORK_REQUIRED / BLOCKED. - Checkpoint — deterministic per-task snapshot enabling resume after
compaction, chat/model/provider switch, restart, or handoff
(
ackit.checkpoint.v1+ verification-bound portable handoffackit.handoff.v2viacheckpoint export --format json/checkpoint import). - Status — canonical read-only projection (
ackit status [id]→ackit.status.v1): task/stage, verbatim blockers, verification + checkpoint freshness, derived next actions; never mutates. CLI ≡ SDK ≡ read-only MCP ≡ Action ≡ VS Code share the snapshot. - Resume / handoff pack — deterministic rendered context (concise resume block; self-contained handoff document) for a fresh agent.
- Drift finding — deterministic machine check result with a frozen code
(e.g.
UNPLANNED_FILE_CHANGE); never a semantic claim. - Autonomy tier — risk classification (0–4) of an action with an allow/ask/deny policy; enforced only at ACKit-owned boundaries (ADR-0028).
- Role contract — portable, data-only YAML contract a provider may use when
spawning subagents (verifier authors
ackit.verdict.v1, persisted by ACKit asackit.verdict.v2); ACKit never spawns or routes agents. - Execution journal — sanitized local-only event log of ACKit-observable transitions; not telemetry; never uploaded.
v0.5 trust chain#
Task/intent/workflow → evidence → bound verification
(ackit.verification-bundle.v2 + persisted ackit.verdict.v2) →
verdict independence/freshness (reviewedBundleDigest,
VERDICT-INDEPENDENCE-UNPROVEN / VERDICT-REPLAY-REJECTED /
VERDICT-STATE-STALE) → canonical status (ackit.status.v1,
read-only) → portable handoff/resume (ackit.handoff.v2) →
CLI / SDK / MCP (read-only) / Action / VS Code.
The existing filesystem/scanner/context architecture above is unchanged;
the trust chain is the verification-to-surface projection built on it.
See docs/guides/demo-trust-flow.md for the reproducible flow.