Skip to content

Keyoku v3: revision-bound Factfile and Progress & attention - #57

Draft
tyejcoleman wants to merge 28 commits into
mainfrom
codex/keyoku-v3-integration
Draft

Keyoku v3: revision-bound Factfile and Progress & attention#57
tyejcoleman wants to merge 28 commits into
mainfrom
codex/keyoku-v3-integration

Conversation

@tyejcoleman

@tyejcoleman tyejcoleman commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Candidate

Exact head: 2e50f91494556adc8910901c8a4848432a7f48f8

This draft assembles the Keyoku v3 modernization candidate while preserving Keyoku's boundary as a harness-neutral assurance layer, not an agent runner or orchestration control plane.

Genuinely functional

  • Exact-source Factfiles with verification receipts and source digests
  • Stale-proof rejection and explicit recapture
  • Progress and attention events with human-decision states
  • Local CLI, MCP, JSONL/file, webhook-oriented adapter contracts, and generic EvidenceProvider/WorkEvent conformance fixtures
  • Deterministic replay, idempotency, duplicate/conflict handling, and source-bound projections
  • Local-first operation without Engine; Engine remains an optional durable service
  • macOS mutable-checkout monitoring that distinguishes deferred APFS clone materialization from real content/topology/ownership changes while retaining exact before/after source-state checks

Revision-bound verification

Run from the clean exact head above:

  • npm test — 40/40 files, 434/434 tests passed
  • npm run typecheck — passed
  • npm audit --audit-level=high and npm audit --omit=dev — 0 vulnerabilities
  • npm run eval — PASS; precision@1 100%, pitfall surface 100%, false-positive 0%
  • npm run preflight — 9/9 candidate checks passed
  • keyoku proof ci github-proof-v1 --base 5d57b56527daf6864c01a1834ce29b05719ec8e8 — 8/8 automated claims passed; 4 human decisions correctly remain pending
  • repeated fresh local Desktop/APFS clones — 20/20 reached the expected evidence-gap result; 0 mutation-monitor false positives
  • exact clean archive install — keyoku-3.0.0-alpha.1.tgz, SHA-256 0a68bfc4653c8d524a92a1e411917d5f940fa360223dce4fa6d4aed99bbe211b
  • clean-archive fresh-clone repetition — 5/5 reached the expected evidence-gap result
  • adversarial coverage rejects write/restore with mtime reset, chmod/restore in executable probe copies, transient add/delete, ignored-path rename/restore, symlink retarget/restore, byte-identical inode replacement, watcher uncertainty, stale source, and probe mutation

Evidence and release boundaries are documented in:

  • docs/SECURITY-REVIEW.md
  • docs/PRODUCTION-READINESS.md
  • README.md

Mutable-checkout regression and repair

The authentic Claude Code + MCP fixture exposed intermittent false source-changed-during-probes and source-changed-after-capture errors in fresh local macOS clones even when captured/current hashes were identical. APFS was asynchronously normalizing directory metadata and emitting deferred ItemCloned/inode-only events after Git returned.

The repaired monitor now:

  • removes directory mtime from source identity while preserving directory object identity;
  • runs executable verification only in fresh disposable checkouts outside the source tree;
  • uses macOS FSEvents semantics to ignore only clone-materialization signatures while failing closed on content, topology, ownership, overflow, root-change, and watcher uncertainty;
  • keeps direct entry monitoring strict after executable-probe setup;
  • revalidates exact bytes, paths, modes, inode, size, and mtime after every probe;
  • fails transient ignored-path churn closed while excluding only Keyoku's generated ledgers and Git internals; and
  • ships an installable macOS watcher dependency from its integrity-locked npm tarball, verified from the exact clean archive.

Honest limitations

  • This is an alpha review candidate, not a public-release approval.
  • PR CI must pass on this exact head before it can be used for final recorded evidence.
  • The concise live Claude Code + Keyoku MCP soak/recording is still pending and will be added only if this exact candidate remains green.
  • Final independent acceptance, security reporting, licensing/repository-posture approval, and npm trusted publication remain release gates.
  • The current mark is provisional; separate owner-reviewed brand directions are pending.
  • Keyoku Engine is separate and is not included in this PR.
  • The public README and hosted site remain on the prior version until separately approved merge/deployment steps.

Rollout and rollback

Review this draft and its checks first. A later, separately approved merge/release can promote the exact accepted candidate. Rollback is unchanged: main, the currently published README, the current hosted site, and the existing npm v2 package remain the preserved public version; closing this PR and deleting its branch leaves them untouched.

No package publication, protected-branch merge, license change, repository visibility change, site deployment/access change, or external announcement is performed by this draft.

tyejcoleman and others added 28 commits July 7, 2026 20:28
goal_update gains addCriteria / removeCriteriaIds / editCriteria so a wrong
or incomplete criterion can be refined without forking a duplicate goal (the
"-v2" portfolio-fragmentation pain this closes). Criteria not referenced are
preserved unchanged; edits are re-validated through the same gate as
goal_create (non-empty, mcp criteria reference a registered connector).

Editing criteria on a converged goal reopens it (active, or blocked if the
budget is exhausted) — safe default, no force flag, mirroring the existing
drift-detection auto-reactivation. The edit is recorded into the goal's
trace as a new ActionRecord source:"system" — visible in goal_get/history
for the learning loop, but excluded from workflow-step promotion and the
totalActions stat since it's bookkeeping, not a reusable action.

Backward compatible: a goal_update call with none of the three new params
behaves exactly as before (same patch logic, same response shape).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d w/ belay)

belay's loop portfolio now scopes proposals by project to stop cross-project
leakage (goalOwnProject reads a project/cwd off the goal row) — but the goal
record had no such field. Adds Goal.project (git repo root of a cwd, or the
cwd itself outside a repo, via projectForCwd() — never throws) and Goal.cwd.

MCP does not hand a tool call the client's cwd; the only reliable signals are
an explicit caller-supplied cwd or the long-lived server process's own
process.cwd() (fixed at spawn time by Claude Code, typically the project
dir). goal_focus already used exactly this convention, so goal_create now
follows it: an optional cwd param defaulting to process.cwd(), so every
newly created goal is stamped going forward. goal_focus backfills
project/cwd on a goal that has neither, from the focus cwd — first stamp
wins, so re-focusing an already-stamped goal from elsewhere never reassigns
it. Surfaced in goal_get, goal_list/goal_create (goalSummary), and directly
in goals.json (how belay reads it).

Backward compat: goals persisted before this field existed have neither key
and are NOT retroactively scoped — no backfill migration, since inferring a
project from free text would produce false positives. They become scopeable
only once re-focused or recreated; belay must treat an absent project/cwd as
"unknown," not "global."

333 -> 340 tests, typecheck clean. Not published (staged for review).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Generic, project-agnostic workflow that makes a recorded product demo
first-class Keyoku evidence: src/demo.ts implements the demo.yaml schema,
a Playwright-driven recorder (screenshots per stop, resolved from the
target project so keyoku itself stays playwright-free), and an
agent-watch step that produces a zod-validated verdict.json usable as an
outcome criterion probe via `keyoku demo record && keyoku demo watch
--assert`. Also raises CommandProbeSchema/HttpProbeSchema's timeoutMs cap
from 300_000 to 900_000 (src/types.ts) since real record/watch pipelines
and frontend builds exceed 5 minutes.

Not wired into src/index.ts's CLI dispatch/help text or CHANGELOG.md in
this commit: both files already carry a large, unrelated, pre-existing
uncommitted diff (a 3.0.0-alpha.1 contribution/proof-session rewrite) that
predates this change and is outside this task's scope; committing them
whole would sweep that unrelated work in under this message. The wiring
(case "demo" in main(), demoCmd import, help text line) and CHANGELOG
entries are applied in the working tree and build/typecheck/behaviorally
tested clean — left uncommitted for the orchestrator to fold in alongside
that pre-existing baseline.
…-theme

Replace the purple-gradient dossier/dashboard layout with a single-scroll,
grayscale light/dark (prefers-color-scheme) Factfile: a demo-replay hero
(auto-advancing screenshot filmstrip, or a terminal-style CLI replay of
every probe when no visual artifacts exist), a short verdict summary,
an Insight section for pending human decisions and proposed directions,
and everything else (full evidence, work log, session, repository info)
reachable in collapsed <details> folds. New minimal monotone logo mark.
Preserves all existing live-session behavior (decision/direction POSTs,
EventSource refresh, theme toggle) and self-contained CSP constraints.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deterministic HTML rendering (personas, sections, video/frames embedded as
data URIs, factfile-driven status, layered architecture SVG, tab bar,
light/dark/auto theme) driven by a per-project .keyoku/deck.yaml validated
with zod. `deck plan` is the only place autonomy lives: it spawns `claude -p`
to draft/update deck.yaml from a natural-language ask; `deck build` never
calls an agent, so the same config always renders the same deck.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ram renderer

Standalone deterministic module (src/arch.ts) with a hand-authored 20-icon
line-icon family, orthogonal rounded-corner edge routing (with a bus-lane
fallback so multi-column or label-overflow edges never cut through
unrelated nodes), zone containers, and a `keyoku arch render` CLI. Wires
into `keyoku deck`'s architecture section (embedded mode, shares design
tokens via ARCH_CSS) as a superset-compatible replacement for the old
inline renderer — existing deck.yaml diagrams keep validating unchanged.
…table decisions, per-frame crop, status lead; bundle harness-portable skills

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ng through every slide

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…load anchor, manual-copy fallback) and quiet focus styles

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…to CSS smooth and still animated); fix escaped newlines in sign-off script

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… highlights what's missing

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s (artifact iframes)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…il in capped webviews (Teams preview)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant