jonah-fleet 1.36.0 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to `jonah-fleet` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.37.0](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.36.0...v1.37.0) (2026-10-11)
9
+
10
+
11
+ ### Features
12
+
13
+ * **prompts,memory:** partition LESSONS.md ingestion by routine role ([#700](https://github.com/Jonah-Projects/jonah-fleet/issues/700)) ([21fe1b2](https://github.com/Jonah-Projects/jonah-fleet/commit/21fe1b21669ee0d7dc470c601732fb395efa0126))
14
+
8
15
  ## [1.36.0](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.35.2...v1.36.0) (2026-10-11)
9
16
 
10
17
 
@@ -23,8 +30,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
23
30
 
24
31
  ### Added
25
32
 
33
+ - **memory:** partition `LESSONS.md` operational memory ingestion by routine role (`[autowork]`, `[peer-review]`, `[general]`) to prevent unbounded prompt token bloat while maintaining high-signal operational memory
26
34
  - **runner:** add head-tail streaming truncation circuit breaker (`DEFAULT_MAX_LINES = 500`, `DEFAULT_MAX_BYTES = 64KB`) for command execution and large tool outputs to prevent context overflow and worker stalls
27
35
 
36
+
28
37
  ### Fixed
29
38
 
30
39
  - **terminal-card:** refine backlog triage hints to provide targeted unblock advice for radar digests and `needs-attention` issues instead of generic `needs-human` prompts
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Operational Memory (LESSONS.md) Partitioning and Filtering
3
+ *
4
+ * Implements role-filtered memory recall inspired by huggingface/funes v1.6.0 (PR #214),
5
+ * allowing autonomous routines (autowork, peer-review, optimizer, etc.) to ingest
6
+ * only role-relevant and general lessons rather than the unbounded file.
7
+ */
8
+ export declare const KNOWN_ROUTINE_ROLES: Set<string>;
9
+ export interface LessonEntry {
10
+ raw: string;
11
+ role: string;
12
+ tag: string;
13
+ title: string;
14
+ symptom?: string;
15
+ rootCause?: string;
16
+ rule?: string;
17
+ }
18
+ export interface LessonEntryInput {
19
+ role?: string;
20
+ tag?: string;
21
+ title: string;
22
+ symptom: string;
23
+ rootCause: string;
24
+ rule: string;
25
+ }
26
+ /**
27
+ * Parses raw LESSONS.md content into header preamble and array of structured entries.
28
+ */
29
+ export declare function parseLessonsFile(content: string): {
30
+ preamble: string;
31
+ entries: LessonEntry[];
32
+ };
33
+ /**
34
+ * Parses structured lesson entries from LESSONS.md body or full file content.
35
+ */
36
+ export declare function parseLessonEntries(content: string): LessonEntry[];
37
+ /**
38
+ * Checks whether a lesson entry matches a given routine role.
39
+ * Includes:
40
+ * - Direct matches (e.g. entry tagged 'autowork' when role is 'autowork')
41
+ * - Composite matches (e.g. entry tagged 'autowork:git')
42
+ * - 'general' entries
43
+ * - General/legacy subsystem entries not claimed by another known routine role
44
+ */
45
+ export declare function isLessonRelevantForRole(entry: LessonEntry, role: string): boolean;
46
+ /**
47
+ * Filters LESSONS.md content to only entries relevant for the active routine role.
48
+ */
49
+ export declare function filterLessonsByRole(content: string, role: string): string;
50
+ /**
51
+ * Formats a structured 3-line lesson entry under the active routine tag.
52
+ */
53
+ export declare function formatLessonEntry(input: LessonEntryInput): string;
54
+ /**
55
+ * Appends a new structured lesson entry to LESSONS.md, enforcing the 25-entry hard cap.
56
+ * If adding the entry exceeds maxEntries, the oldest entries are evicted.
57
+ */
58
+ export declare function appendLessonEntry(content: string, input: LessonEntryInput, options?: {
59
+ maxEntries?: number;
60
+ }): string;
61
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/lib/memory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,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
  "name": "jonah-fleet",
3
- "version": "1.36.0",
3
+ "version": "1.37.0",
4
4
  "description": "Standalone autonomous agent fleet with Symphony orchestration, claim protocols, and continuous improvement loops",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -98,3 +98,10 @@ To trigger the Autowork routine manually on any specific issue, use the GitHub A
98
98
  - Auth boundaries required for all sensitive mutations.
99
99
  - Never commit credentials, tokens, or secret keys to version control.
100
100
  - Validate request inputs and sanitize outputs.
101
+
102
+ ## Operational Memory (LESSONS.md)
103
+
104
+ - **Role-Partitioned Memory**: Standardize lesson entries in `LESSONS.md` using routine role tags: `[autowork]`, `[peer-review]`, `[optimizer]`, or `[general]` (e.g. `### [autowork] Title`, `### [peer-review] Title`, `### [general] Title`). Subsystem composite tags are also supported (e.g. `### [autowork:subsystem] Title`).
105
+ - **Targeted Routine Ingestion**: Autonomous routines ingest general lessons plus routine-specific lessons, omitting unrelated entries to prevent unbounded token expansion while maintaining high-signal operational memory.
106
+ - **Post-Run Recording**: When capturing new non-obvious gotchas or quirks on PR branches, always tag the entry with the active routine's role (or `[general]`) and adhere strictly to the 25-entry hard cap.
107
+
@@ -1,7 +1,9 @@
1
1
  # Operational Lessons & Repository Heuristics
2
2
  <!-- Invariants: Max 25 entries. Hard cap. Older entries graduate or demote to LESSONS_ARCHIVE.md -->
3
+ <!-- Tagging Syntax: Standardize entries with routine role tags [autowork], [peer-review], [optimizer], or [general] (e.g. ### [autowork] Title, ### [peer-review] Title, ### [general] Title). Subsystem suffixes are supported: ### [autowork:subsystem] Title. Each routine ingests only its own role-tagged entries plus [general] and legacy entries. -->
3
4
 
4
5
  ### [subsystem] Title
6
+ <!-- Example role-tagged entry: ### [general] Title or ### [autowork] Title -->
5
7
  - **Symptom:** <Symptom description or error message>
6
8
  - **Root Cause:** <Brief explanation of the underlying cause>
7
9
  - **Rule:** <Actionable rule or constraint to follow>
@@ -220,7 +220,7 @@ _Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/ru
220
220
  `- **Prior Failure Context**: <summary of past error/crash and strategy to avoid repeating it>`
221
221
  - If bug: use `/diagnosing-bugs` to establish reproduction test before fixing.
222
222
  - If large/complex: use `/domain-modeling` and `/codebase-design`.
223
- - **Pre-Flight Memory Scan**: If `LESSONS.md` exists, grep matching subsystem tags (`grep -E "^### \[(subsystem)\]" LESSONS.md -A 4`) to incorporate known landmines into implementation plans before writing code.
223
+ - **Pre-Flight Memory Scan**: If `LESSONS.md` exists, grep matching subsystem tags (`grep -E "^### \[(subsystem)\]" LESSONS.md -A 4`) or filter entries tagged for `[autowork]` or `[general]` (e.g. `grep -E "^### \[(autowork|general)\]" LESSONS.md -A 4`), omitting unrelated routine roles to incorporate known landmines into implementation plans before writing code without token bloat.
224
224
  - **The Red Gate Protocol (Pre-Implementation Verifier Check)**: Before writing ANY production implementation code, define the verifier or write a reproduction test, and execute it:
225
225
  - **The check MUST fail** (red). If the verifier passes before you touch production code, the subsequent work proves nothing.
226
226
  - **Already Green Check**: If the verifier passes *before* code changes, stop immediately and evaluate:
@@ -268,7 +268,7 @@ _Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/ru
268
268
  - **Diagnostic Reflex**: On unexpected test/build failure during TDD, grep symptom text in `LESSONS.md` before making speculative code edits.
269
269
  - Run repository tests and verification.
270
270
  - **Disk Read-Back Verification**: Verify written configs, schemas, and generated files by reading values directly back from disk files (`cat`, `jq`, test assertions), never from shell variables or memory.
271
- - **Pre-PR Lessons Capture Gate**: If solving the issue required overcoming a non-obvious quirk not caught by tests/linters, append a 3-line structured entry on the active PR branch adhering to the 25-entry hard cap. Never write to `LESSONS.md` directly on `main`.
271
+ - **Pre-PR Lessons Capture Gate**: If solving the issue required overcoming a non-obvious quirk not caught by tests/linters, append a 3-line structured entry tagged under the active routine role (`### [autowork] <Title>` or `### [general] <Title>`) on the active PR branch adhering to the 25-entry hard cap. Never write to `LESSONS.md` directly on `main`.
272
272
  - **Milestone 2 (Verification & Tests)**: Once implementation passes tests and type checks, emit milestone card if `$ROUTINE_ISSUE_NUMBER` is set:
273
273
  ```bash
274
274
  gh issue comment "$ROUTINE_ISSUE_NUMBER" --body "### 🧪 Milestone: Verification & Tests
@@ -365,7 +365,7 @@ Cacheable across consecutive runs within the same repository.
365
365
  In this tier, Autowork ingests semi-stable repository conventions, operational memory, and configuration rules that change infrequently across consecutive runs in the same repository:
366
366
 
367
367
  1. **Repository Conventions (`AGENTS.md`)**: Read `AGENTS.md` (or `CLAUDE.md` / `GEMINI.md`) for build/test/lint commands, code formatting rules, architectural guidelines, and design system tokens.
368
- 2. **Operational Memory (`LESSONS.md`)**: If `LESSONS.md` exists, ingest active operational gotchas (`grep -E "^### \[(subsystem)\]" LESSONS.md -A 4`) to avoid known pitfalls and regression patterns (enforcing the 25-entry hard cap).
368
+ 2. **Operational Memory (`LESSONS.md`)**: If `LESSONS.md` exists, ingest role-relevant operational gotchas (`grep -E "^### \[(subsystem)\]" LESSONS.md -A 4`) filtered for the active routine role (`[autowork]` or `[general]`), omitting entries from other routine roles to avoid known pitfalls and regression patterns while minimizing token consumption (enforcing the 25-entry hard cap).
369
369
  3. **Fleet Manifest (`agents-manifest.json`)**: Ingest configured presets, model family assignments, and timeout/iteration ceilings.
370
370
  4. **Engineering Skills (`.agents/skills/`)**: Leverage domain skills (`code-review`, `codebase-design`, `diagnosing-bugs`, `domain-modeling`, `grill-me`, `resolving-merge-conflicts`, `tdd`, `triage`, `writing-for-agents`).
371
371
 
@@ -142,7 +142,7 @@ Check if `$PR_NUMBER` is set:
142
142
  1. Run `/code-review` over the diff (or delta commits if re-review) evaluating:
143
143
  - **Standards**: Conformance to `AGENTS.md` (or `CLAUDE.md`/`GEMINI.md`), conventions, and architecture.
144
144
  - **Spec Compliance**: Verification against the linked issue's deliverables (`## Tasks`), or against the PR description's summary/changes if no tracking issue is linked.
145
- - **Operational Memory & Lessons Invariant**: Inspect `LESSONS.md` diffs in PRs to verify the lesson is accurate, non-trivial, follows the 3-line structured schema, and the file adheres to the 25-entry hard cap.
145
+ - **Operational Memory & Lessons Invariant**: Inspect `LESSONS.md` diffs in PRs to verify the lesson is accurate, non-trivial, follows the 3-line structured schema, tags the originating routine role (e.g. `### [autowork] ...`, `### [peer-review] ...`, or `### [general] ...`), and the file adheres to the 25-entry hard cap. If reviewing code that solves a non-obvious gotcha or recurring architectural trap, ensure a structured 3-line entry tagged with the originating routine role (`### [peer-review] ...` or `### [general] ...`) is appended to `LESSONS.md`.
146
146
  2. Run Security Pass: auth gates, permission checks, injection risks, sensitive credentials.
147
147
  3. **Design System & Viewport Density Pass** (if PR modifies frontend/rendered UI):
148
148
  - **Token Purity**: Check for arbitrary CSS/Tailwind sizing overrides (e.g. `text-[...px]`, `w-[...px]`) or bespoke button styling bypassing standard design system tokens.
@@ -298,7 +298,7 @@ Cacheable across consecutive runs within the same repository.
298
298
  In this tier, Peer Review ingests semi-stable repository conventions, operational memory, and configuration rules that change infrequently across consecutive runs in the same repository:
299
299
 
300
300
  1. **Repository Conventions (`AGENTS.md`)**: Read `AGENTS.md` (or `CLAUDE.md` / `GEMINI.md`) for coding standards, architectural patterns, design system token purity, and required CI / test commands.
301
- 2. **Operational Memory (`LESSONS.md`)**: Verify that any non-obvious quirks or gotchas captured on the active PR branch adhere to the 25-entry hard cap.
301
+ 2. **Operational Memory (`LESSONS.md`)**: If `LESSONS.md` exists, ingest role-relevant operational gotchas filtered for the active routine role (`grep -E "^### \[(peer-review|general)\]" LESSONS.md -A 4`), omitting unrelated routine roles, and verify that any non-obvious quirks or gotchas captured on the active PR branch adhere to the 25-entry hard cap.
302
302
  3. **Fleet Manifest (`agents-manifest.json`)**: Ingest configured review models, round caps, and iteration ceilings.
303
303
  4. **Engineering Skills (`.agents/skills/`)**: Leverage `code-review`, `design-critique`, and `writing-for-agents` for structured evaluation.
304
304