Skip to content

PR5 v0.5.0 - researchDoc + meetingCapture PatternAdapters - #5

Open
bettercallzaal wants to merge 1 commit into
feat/pr4-file-memoryfrom
feat/pr5-more-patterns
Open

PR5 v0.5.0 - researchDoc + meetingCapture PatternAdapters#5
bettercallzaal wants to merge 1 commit into
feat/pr4-file-memoryfrom
feat/pr5-more-patterns

Conversation

@bettercallzaal

Copy link
Copy Markdown
Owner

Stacked on PR #4. Rebase target switches to main after PR4 merges.

What this PR teaches

Until now only hermes-bug-fix shipped. The framework was wired for multiple patterns but only one was implemented. PR5 widens applicability without touching the core: two new PatternAdapters covering the bulk of ZAO use cases.

Patterns are the unit of "what kind of work can the orchestrator route". Each one packages a system prompt + tool whitelist + cost cap as one composable. New use case = one new file under src/patterns/, no core changes.

What ships

Pattern Matches Tools costCap
researchDoc research, investigate, audit, look into, survey, compare WebFetch, WebSearch, Read, Write, Edit, Grep, Glob, Bash $5.00
meetingCapture meeting, transcript, recap, standup, extract action items, OR any media file extension (.mp4 .m4a .mov .mp3 .wav .opus .flac) Bash, Read, Write, Edit, Grep, Glob $3.00

Each pattern's prepare() few-shot injects past memory hits into its system prompt, so the FileMemory loop from PR4 starts paying off across all three patterns the moment they accumulate runs.

Router picks the right one when all three are registered

"fix the type error in foo.ts"       -> hermes-bug-fix
"research the best vector db"        -> research-doc
"process /tmp/Arthur-x-Zaal.mp4"     -> meeting-capture
"write a haiku about ducks"          -> unknown

The classifier walks each pattern's matches() in registration order and returns the first hit; unknown means "operator, classify this for me". Tested in tests/patterns.test.ts.

System prompts encode the ZAO workflows

  • researchDoc: zao-research v2 - dup-check existing library, climb the fetch ladder (WebFetch → exa → Playwright → Wayback), classify every source FULL/PARTIAL/FAILED, recommendations-first Key Decisions table, Next Actions bridge.
  • meetingCapture: /meeting v2 multi-pass - metadata, decisions, actions, quotes, research seeds, entity cross-check, confidence (high/medium/low) on every decision + action, ambiguous-owner surfacing rule.

These are the workflows Zaal already runs in ZAOOS via slash-commands; they now ship as a portable PatternAdapter so any host of the framework gets the same discipline.

Verification

typecheck   clean
tests       45 passed / 0 failed
            (autonomy 7, router 3, supervisor 8, orchestrator 8, file-memory 5,
             learning-loop 2, patterns 12)
build       clean dist/

New tests (tests/patterns.test.ts):

  • researchDoc matches research/investigate/audit, does NOT match bug-fix or meeting
  • researchDoc prepare shape + few-shot
  • meetingCapture matches keywords + media file extensions
  • meetingCapture does NOT match research or bug-fix
  • Router picks the correct pattern when all three are registered

Limit left for PR6

Patterns ship the system prompts but don't yet own the post-completion side effects. A meeting recap gets WRITTEN by the Hermes session via Write/Edit, but updating research/events/_meetings-index.md or appending to cowork-zaodevz/data/actions.json is still operator work. PR6 adds an optional postComplete(outcome) hook to PatternAdapter so patterns can codify distribution too.

Lands on merge

  • Auto-tag v0.5.0 after PR4 → PR5 cascade
  • Framework now ships THREE production-shaped PatternAdapters

🤖 Generated with Claude Code

Until now only hermes-bug-fix existed. The framework was wired for
multiple patterns but only one was shipped. PR5 widens applicability
without touching the core: two new PatternAdapters that together cover
the bulk of ZAO use cases (research docs + meeting capture).

What ships:
- src/patterns/research-doc.ts
  Matches: research / investigate / audit / look into / survey / compare
  Tools: WebFetch, WebSearch, Read, Write, Edit, Grep, Glob, Bash
  SystemPrompt: zao-research v2 workflow - dup-check, fetch ladder,
  FULL/PARTIAL/FAILED classification, recommendations-first decision
  table, Next Actions bridge.
  costCap: 5.0 (research goes deeper than a bug fix).
- src/patterns/meeting-capture.ts
  Matches: meeting / transcript / recap / standup / extract action items
  + any media-file extension (.mp4, .m4a, .mov, .mp3, .wav, .opus, .flac)
  Tools: Bash, Read, Write, Edit, Grep, Glob
  SystemPrompt: /meeting v2 multi-pass schema - metadata, decisions,
  actions, quotes, research seeds, entity cross-check, confidence on
  every decision + action, ambiguous-owner surfacing rule.
  costCap: 3.0.

Same shape as hermes-bug-fix - few-shot inject past memory hits into
the systemPrompt, so the FileMemory loop from PR4 starts paying off
across all three patterns the moment they accumulate runs.

Router picks the right one when all three are registered:
- "fix the type error in foo.ts"       -> hermes-bug-fix
- "research the best vector db"        -> research-doc
- "process /tmp/Arthur-x-Zaal.mp4"     -> meeting-capture
- "write a haiku about ducks"          -> unknown

Surface area:
- src/patterns/research-doc.ts (~45 LOC)
- src/patterns/meeting-capture.ts (~55 LOC)
- src/index.ts - re-exports both
- package.json - exports map adds ./patterns/research-doc + ./patterns/meeting-capture
- tests/patterns.test.ts - 12 tests across keyword match, media-file
  match, prepare shape, few-shot injection, router multi-pattern pick

Tests: 45/45 pass (+12 patterns).

Known limit (PR6): the patterns ship the system prompts but do not yet
own the post-completion side effects (the recap doc gets WRITTEN by the
Hermes session via Write/Edit, but updating research/_meetings-index.md
or appending to cowork-zaodevz/data/actions.json is still operator
work). PR6 may add an optional `postComplete(outcome)` hook to
PatternAdapter so patterns can codify the distribution step too.

Co-Authored-By: Claude Opus 4.7 (1M context) <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