feat(knowledge): Context-Aware Delegation und Microtasking-Policy - #3
Merged
Merged
Conversation
Fügt knowledge/delegation.json, context-pack.json, Doku unter docs/, Beispiele, Evaluation A–H und Tests hinzu — ohne paralleles Routing. Co-authored-by: Cursor <cursoragent@cursor.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.
Intent
Erweitere firstmate-crew-knowledge um Context-Aware Microtasking + Delegation Knowledge: belastbares Knowledge-/Behaviour-Modell für konsequente Delegation (Firstmate als Dispatcher, nicht als Implementierer) und kontextbewusstes Microtasking nur bei ausreichendem Context Pack. Dokumentiere Failure-Modes (Eigenarbeit, Chat-Noise, Approval, Crewmate→Captain). Deliverables: docs/context-aware-microtasking.md, delegation-policy.md, context-sufficiency.md, approval-policy.md, firstmate-failure-modes.md; knowledge/delegation.json und context-pack.json; examples/ (simple microtask, context pack, not microtaskable, full-context, scout→ship, conflicting results); evaluation/delegation-cases A–H; Firstmate-Abweichungstabelle mit Code-Evidenz (IMPLEMENTIERT|DOKUMENTIERT|TEILWEISE|NICHT VORHANDEN). Keine zweite parallele Model-Routing-/Approval-Engine; bestehenden fm-spawn/quota-array-dispatch respektieren. Ship/Scout vs Execution Mode klar trennen. Evidence Chain, Progressive Context Expansion, Compression≠Loss, no blind synthesis. Tests für JSON-Struktur.
What Changed
knowledge/delegation.jsonundknowledge/context-pack.json(Delegate-first, Context Dependency, Execution Modes inkl. Ship/Scout-Trennung, Evidence Chain, Ownership gegenüberfm-spawn/quota-array-dispatch).docs/(Delegation, Microtasking, Context Sufficiency, Approval, Failure-Modes inkl. Firstmate-Abweichungstabelle), sechs Szenarien inexamples/und Evaluationsfälle A–H.docs/,examples/undevaluation/ins npm-Paket und sichert die JSON-/Ownership-/Evaluationsstruktur mittests/delegation-knowledge.test.tsab.Risk Assessment
✅ Low: Well-bounded policy/docs/knowledge deliverables with no second routing or approval engine and no runtime spawn changes; prior review findings are verified fixed in source.
Testing
Erweiterte JSON-Semantik-Tests und ein Consumer-Walkthrough über das Live-Knowledge-Modell (Modi, Dependency-Levels, Context-Pack-Gate, Cases A–H, Ownership ohne zweiten Router) sind grün; gerenderte HTML-/PNG-Evidence zeigt die Knowledge-Surface inklusive Abweichungstabelle.
/tmp/no-mistakes-evidence/01M0GDQBX4J6JS7SPD3PV07JWG/delegation-knowledge-surface.png)Evidence: Reviewer-visible HTML evidence surface built from live knowledge JSON
Evidence: End-to-end consumer walkthrough transcript
Evidence: delegation-knowledge.test.ts run output
Evidence: Evaluation A–H resolution against live policy model
Evidence: Parsed Firstmate-Abweichungstabelle with status validation
Evidence: Ownership and Case D/F policy checks (excerpt)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 3 issues found → auto-fixed (2) ✅
tests/delegation-knowledge.test.ts:42- The third test asserts ownership only via regex/substring over joined or stringified JSON (assert.match(..., /fm-spawn/),assert.doesNotMatch(JSON.stringify(d.executionModes), /parallel router|auto-spawn/i)). That is source-content-only and can pass while the semantic contract drifts. Refine to membership/shape checks on the parsed model (e.g.firstmateExistingcontainsbin/fm-spawn.sh;executionModeshas exact mode ids; ownership fields assert policy-only scope) instead of forbidding incidental prose tokens.CLAUDE.md:1- User intent requires Delegation/Microtasking knowledge deliverables and does not authorize changing CLAUDE.md. This commit replaces the AGENTS.md symlink (mode 120000) with a 2-line@AGENTS.mdstub (mode 100644). Any consumer that reads CLAUDE.md expecting the full agent guide now gets only the import pointer. Confirm whether this Claude-import change is intentional and in-scope, or revert it from this branch.docs/firstmate-failure-modes.md:140- Intent requires a Firstmate-Abweichungstabelle mit Code-Evidenz using status vocabulary IMPLEMENTIERT|DOKUMENTIERT|TEILWEISE|NICHT VORHANDEN. Section 7's table uses Current/Expected/Gap/Knowledge Fix/Code Fix? instead: several rows lack a status code and concrete evidence path (e.g. chat-noise / conflict rows), and TEILWEISE is never used even where partial implementation is described. Align each row with Status + code/doc evidence path (as already done in docs/delegation-policy.md lines 7–13), or confirm the looser Gap table is accepted as that deliverable.🔧 Fix: Ownership-Asserts und Status-Evidenz-Tabelle gehärtet
1 warning still open:
docs/firstmate-failure-modes.md:146- Intent requires Firstmate-Abweichungstabelle mit Code-Evidenz, but Evidence cells cite bare paths (AGENTS.md§7/§9,docs/subagent-guard.md,docs/architecture.md,.agents/skills/ask-user-authority/SKILL.md,bin/fm-*.sh) that resolve incorrectly inside this package: local AGENTS.md has no §1/§7/§9, and those docs/bin/skill paths are absent here (they live under Firstmate home). Same bare citations appear in docs/delegation-policy.md and docs/approval-policy.md, while docs/README.md already distinguishesAGENTS.mdim Firstmate-Repo. Qualify Firstmate-external evidence (e.g. Firstmate-RepoAGENTS.md§7 or$FM_HOME/...) so Status claims stay verifiable and do not collide with this package's own AGENTS.md/docs/.🔧 Fix: Firstmate-Evidenzpfade qualifiziert und Fußnote ergänzt
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
node --test --experimental-strip-types --no-warnings --test-force-exit tests/delegation-knowledge.test.ts(9 assertions: Struktur, Ownership/fm-spawn, Evidence-Chain, Context-Pack-Gate, HIGH/VERY_HIGH microtaskDefault, Evaluation A–H, kein Parallel-Router, Deliverables)Manual consumer walkthrough: liveknowledge/delegation.json+knowledge/context-pack.jsongegen Cases A–H, Sufficiency-Gate, noBlindSynthesis, OwnershipParsedocs/firstmate-failure-modes.md§7 Abweichungstabelle → Status nur IMPLEMENTIERT|DOKUMENTIERT|TEILWEISE|NICHT VORHANDENRender + Chrome screenshot of evidence HTML surface from live JSON model✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.