⚠️ AI-Agent-Only RepositoryThis repo is planned, maintained, and managed exclusively by AI Agents. Slop issues, rough edges, and AI artifacts are expected and intentionally present as part of an HITL-less / minimized AI-DD metaproject focused on learning, refining, and brute-force training both the agents and the human operator. Bug reports and contributions are still welcome, but please expect AI-generated code, comments, and documentation throughout.
Shared, project-agnostic journey harness for the Phenotype org: record a user-facing flow (CLI tape, UI test, or Playwright trace), emit a canonical manifest, and verify it with a Claude-describe + Claude-judge loop.
Journey harness code kept accreting inside individual projects — VHS tapes +
manifest JSON in hwLedger/apps/cli-journeys/, XCUITest capture in
hwLedger/apps/macos/HwLedgerUITests/, a JourneyViewer.vue in the hwLedger
docs theme, a hwledger-gui-recorder crate. None of it was reusable. Every
new Phenotype project that wanted journeys had to re-derive the format and
the verify loop from scratch.
phenotype-journeys extracts those into one package:
- Canonical manifest schema (
schema/manifest.schema.json) — source of truth for step/verification shape. phenotype-journey-core(Rust) — serde types, schema export, and the verify loop in bothmockandlive(Anthropic API) modes.phenotype-journey(Rust CLI) —record,verify,validate,sync.@phenotype/journey-viewer(Vue 3) —JourneyViewer+RecordingEmbedcomponents for VitePress docs.@phenotype/journey-playwright(TypeScript) — script a web page and emit a conformant manifest.
Journey evidence is part of the repo contract, not just a consumer concern. See docs/journey-traceability.md for the shared standard and repo expectations.
- hwLedger — swap
apps/cli-journeys/scripts/verify-manifests.sh+ in-themeJourneyViewer.vuefor this package. (SeeMIGRATION.mdin the hwLedger repo.) - AgilePlus — journeys for feature specs (one per tagged FR).
- thegent — journeys for plugin onboarding flows.
Consuming projects should fail their quality gate if a spec tagged as user-facing does not have a corresponding passing journey manifest. Enforce via CI:
phenotype-journey validate docs/journeys/manifests/<spec-id>/manifest.verified.json# 1. Record a CLI tape (wraps charmbracelet/vhs)
phenotype-journey record --tape tapes/first-plan.tape --out journeys/
# 2. Write a stub manifest (hand-authored or from journey-playwright)
# 3. Validate against the canonical schema
phenotype-journey validate journeys/manifests/first-plan/manifest.json
# 4. Verify (mock mode, offline, no API key needed)
phenotype-journey verify journeys/manifests/first-plan/manifest.json
# 5. Ship artefacts to the docs public dir
phenotype-journey sync --from journeys --to docs/public/journeysSet ANTHROPIC_API_KEY and pass --live (requires building with
--features live) to call real Claude for describe + judge passes.
Claude-judge alone is soft. A tape can literally display
error: unexpected argument and still pass if the judge hallucinates. The
assert subcommand adds hard gates that fail the build when frame content is
wrong.
tesseractCLI — install withbrew install tesseract(macOS) orapt-get install tesseract-ocr(Debian). No silent skip: if tesseract is missing the command exits non-zero with a clear message.- Override OCR for tests or custom pipelines via
PHENOTYPE_JOURNEY_OCR_CMD="my-ocr {{PATH}}"(the{{PATH}}token is replaced with the PNG path).
Each step may carry an assertions block:
journey: traceability-report
steps:
- index: 1
intent: "Command typed: cargo run ..."
assertions:
must_contain: ["cargo run", "hwledger-traceability"]
must_not_contain: ["error:", "unexpected argument"]
ocr_required: true
- index: 8
intent: "Integer row-count returned"
assertions:
expected_exit: 0must_contain— every listed substring must appear in the OCR of that step's keyframe.must_not_contain— none of the listed substrings may appear.expected_exit— the LAST keyframe of the journey must include the sentinel__EXIT_<N>__.ocr_required— reserved for future "OCR must succeed" gating; default inferred from the presence of contain/not_contain lists.
Wrap the final command in the tape so the sentinel lands in the recording:
Type "hwledger plan --help; echo __EXIT_$?__"
Enter
Sleep 500msThis produces a visible __EXIT_0__ (or __EXIT_N__) in the last frame that
phenotype-journey assert can OCR and gate on.
phenotype-journey assert apps/cli-journeys/manifests/plan-deepseek/manifest.json --strictWith --strict, exits non-zero when any assertion is violated. Without, the
report prints but the process exits 0. Journeys with zero assertions print a
loud warning so they cannot hide.
The phenotype-journey verify subcommand is the canonical CI gate for journey
manifests. The first-class surface takes --manifest <path> (alias
--manifest-path) and --docs-root <path> so it slots directly into phenodocs
PR #168 and any consumer following the
journey-traceability standard:
phenotype-journey verify \
--manifest docs/journeys/manifests/phenodocs-bootstrap.journey.json \
--docs-root docsThe flag pair runs the Claude-describe + Claude-judge verify loop in mock
mode (offline, deterministic) and also runs the OCR-backed assertion engine
against <docs-root>/keyframes/<id>/frame-###.png, then emits a unified
JSON envelope. The process exits non-zero when all_intents_passed is false
OR any must_contain / must_not_contain / expected_exit violation trips
— making the gate a hard fail for the build. The legacy positional
phenotype-journey verify <path> form still works for backwards
compatibility, and --live switches to the real Anthropic API backend when
the live cargo feature is enabled and ANTHROPIC_API_KEY is set.
phenotype-journeys/
crates/phenotype-journey-core/ # Rust lib: types, schema, verify loop
bin/phenotype-journey/ # Rust CLI
npm/journey-viewer/ # Vue 3 components
npm/journey-playwright/ # Playwright -> manifest bridge
schema/manifest.schema.json # Canonical JSONSchema
Apache-2.0.
This repository includes the following cross-cutting documents:
AGENTS.md— operating instructions for AI agents and human contributorsdocs/— design notes, ADRs, and supporting documentation (seedocs/index.md)