Claude/convoy readme installer#40
Merged
Merged
Conversation
…r Component next/dynamic with ssr:false is forbidden inside Server Components in Next.js 15. All three canvas components (PipelineHero, HeroCards, Starfield) already carry 'use client' at the top, so importing them directly from the page creates the correct client boundary without needing next/dynamic at all. Canvas drawing runs inside useEffect and is never touched during SSR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…orts Resolved conflict in web/app/page.tsx: kept origin/main's hero-dynamic client wrapper approach (correct Next.js 15 pattern) over our direct import approach. Also picks up nested-lane planner detection and rehearsal runner location fixes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a Hermes-inspired agent memory layer that closes the feedback loop between runs: each run teaches future plans, and future plans load that teaching before Opus drafts. ## What was built ### src/core/memory.ts (ConvoyMemory) Three-tier memory store backed by the existing SQLite database (four new tables, schema-migrated on first open): - Semantic (memory_facts): confidence-weighted key/value facts about a repo, e.g. "preferred_platform: fly [95%]" - Episodic (memory_outcomes): one compressed row per run — status, platform, p99, error_rate, medic classification, Opus lesson - Procedural (memory_skills): reusable step-by-step patterns discovered across runs; ranked by use_count - Decision traces (decision_traces): links Opus platform picks to run outcomes so override patterns surface as drift buildContextSummary(localPath) assembles a Markdown block from all three tiers, injected into the enricher system prompt before Opus plans. ### src/core/learn.ts (learnFromRun) Post-run Opus 4.7 pass. Reads the last 40 run events + plan context, extracts a lesson sentence, 1–3 confidence-weighted facts (threshold 0.6), and 0–2 skill docs. Writes to ConvoyMemory. Failures are silently discarded — a learn error must never fail a run. ### src/core/orchestrator.ts - Accepts optional ConvoyMemory in constructor (fourth param, opt-in) - After every run completion (success, breach, rollback): calls #triggerLearn() as fire-and-forget — .catch(() => void 0) so the orchestrator never awaits the learn pass ### src/planner/enricher.ts - New EnrichmentOptions.priorContext?: string - When populated, appended to the system prompt so Opus has prior history when drafting this plan. First run for a repo = empty = no change. ### src/cli.ts - Imports ConvoyMemory; constructs one instance per apply/plan/ship call - runApply: passes memory to Orchestrator constructor - plan/ship buildPlan calls: build priorContext from memory and inject into EnrichmentOptions.ai.priorContext ### plugin/agents/memory-agent.md Claude Code subagent. Queries memory_facts, memory_outcomes, memory_skills, decision_traces directly via sqlite3. Surfaces prior history, patterns, and platform preference drift for a given target path. ### docs/architecture.md + README.md Updated with memory layer diagram (mermaid), closed-loop flow description, four-layer architecture breakdown, and memory data flow ASCII diagram. ## Design invariants (from Hermes case study) - Learning is prompt augmentation, not weight mutation - Memory writes are async and non-blocking - No secret values enter memory - Skill docs are operator-inspectable via sqlite3 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… pass
Implements the Hermes ~50% threshold context compression strategy in two
places where unbounded growth was the real problem.
## src/core/compress.ts (new)
Two exported functions:
compressMessageHistory(client, messages, model)
Fires when accumulated medic message chars exceed 12 000 (~3 000 tokens).
Extracts all tool-result content, calls Opus to produce a compact findings
summary, then rebuilds the message array as:
[initial_user_prompt] + [compressed_findings] + [last_assistant_turn]
Keeps the last assistant turn so the model knows where it left off.
Falls back to the original messages on any error — never breaks the loop.
compressRunEvents(events, opts)
Fires when the serialized event log exceeds 32 000 chars (~8 000 tokens).
Below threshold: verbatim formatting of all events.
Above threshold: Opus produces a compact narrative preserving stage
outcomes, metric values, error messages, and medic findings.
Falls back to events.slice(-40) tail truncation when no API key is
available or when the compression call throws.
## src/core/medic.ts
- messages changed from const to let (required for reassignment)
- Midpoint check inserted at turn === Math.floor(MAX_TURNS / 2) (turn 3):
calls compressMessageHistory before the API call, reassigns messages.
A 6-turn medic that reads two large files + a log tail no longer carries
~12 000 chars of tool output into turns 4–6.
## src/core/learn.ts
- events.slice(-40).map(...) replaced with await compressRunEvents(events, {apiKey})
A long multi-lane run with 200+ events is now compressed by Opus rather
than blindly tail-truncated. Short runs (< 32 000 chars) are unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.