Skip to content

feat(mt#1796): decision-defaults §Agent todos vs. Minsky tasks — durable/ephemeral boundary#1082

Merged
edobry merged 3 commits into
mainfrom
task/mt-1796
May 12, 2026
Merged

feat(mt#1796): decision-defaults §Agent todos vs. Minsky tasks — durable/ephemeral boundary#1082
edobry merged 3 commits into
mainfrom
task/mt-1796

Conversation

@minsky-ai
Copy link
Copy Markdown
Contributor

@minsky-ai minsky-ai Bot commented May 12, 2026

Summary

  • Encodes the Shape B policy decision from the Notion position paper Position: Agent todos vs. Minsky tasks — the durable/ephemeral boundary in the orchestration domain model (2026-05-12) as a new section in .minsky/rules/decision-defaults.mdc.
  • Originating incident: during a single-task Minsky skill chain (investigate mt#1786 → DONE on 2026-05-12), Claude Code's TaskCreate reminder fired 12+ times and the agent visibly echoed "Ignoring harness reminder" each time, turning harness noise into chat noise.
  • The fix is environmental shaping (rule policy), not behavioral retraining (memory entry). Per the Minsky design principle: alignment is achieved through environmental design, not training or instruction.

Key changes

  • .minsky/rules/decision-defaults.mdc — new ## Agent todos vs. Minsky tasks: durable to Minsky, ephemeral to harness section with operational policy bullets (durable / ephemeral / inside-skill-chain / reminder-disregard), Generic-SE override line, deferred follow-up pointer to mt#1797, pattern note framing this as the second instance of the "Minsky abstraction meets harness-native primitive" shape (mt#1316 was the first), and a worked example contrasting in-skill-chain vs. pre-task-triage usage.
  • .minsky/rules/decision-defaults.mdc Cross-References — added pointers to the originating memory, Notion paper, mt#1316, mt#1796 (this task), and mt#1797 (deferred Shape C).
  • CLAUDE.md, AGENTS.md, .cursor/rules/decision-defaults.mdc — regenerated from the updated source via the rules-compile pipeline (NO direct edits).
  • Memory entry feedback_agent_todos_vs_minsky_tasks (id 94c6eb16-7bde-4576-acaa-fabf87df708d) — created as the originating memory the rule's Generic-SE override: line references.

Compile-pipeline evidence (R1 BLOCKING ack)

The reviewer-bot's R1 BLOCKING asked to confirm CLAUDE.md / AGENTS.md / .cursor/rules/decision-defaults.mdc were regenerated through the compile pipeline rather than edited directly — guarding against the mt#1678 incident class. Confirmation below:

Commands run (in the session workspace):

bun src/cli.ts rules compile --target claude.md       # → ✅ Success
bun src/cli.ts rules compile --target agents.md       # → ✅ Success
bun src/cli.ts rules compile --target cursor-rules    # → ✅ Success

Pre-commit hook output (from bun run src/hooks/pre-commit.ts invoked by .husky/pre-commit, last run before the commit on this branch):

🔍 Running pre-commit validation...
🔐 Checking hook file permissions...
✅ No hook files staged.
🎨 Running code formatter...
✅ Code formatting completed.
🔇 Checking for console usage violations...
✅ No console usage violations found.
🔍 Checking for variable naming issues...
✅ No variable naming issues found.
🚫 Checking for Node.js shims in staged files...
✅ No Node.js shims in staged files.
🔎 Running TypeScript type check...
✅ TypeScript compilation passed — no type errors.
🔍 Running ESLint with strict quality gates...
📊 ESLint Results: Errors: 0  Warnings: 0
✅ Perfect! Zero errors and zero warnings detected.
🔒 SECURITY: Scanning for secrets...
✅ Gitleaks: No secrets detected in staged changes (enhanced scan complete).
🧪 MANDATORY: Running unit test suite...
✅ All tests passing! Test suite validation completed.
🔧 Running ESLint rule tooling tests...
✅ ESLint rule tooling tests completed.
📋 Checking rules compile outputs are up-to-date...
✅ All rules compile outputs are up-to-date (agents.md, claude.md, cursor-rules).
✅ All checks passed! Commit proceeding...

The Checking rules compile outputs are up-to-date step IS the structural guard against direct edits: it re-runs rules compile and diffs the output against the staged files. If the staged compiled files differ from a fresh compile, the hook blocks. This is verifiable in src/hooks/pre-commit.ts's pipeline-check logic. The commit succeeded → the staged AGENTS.md / CLAUDE.md / .cursor/rules/decision-defaults.mdc are byte-identical to what rules compile produces from the staged .minsky/rules/decision-defaults.mdc.

R1 response to other findings

  • NON-BLOCKING (tool naming tasks_createmcp__minsky__tasks_create) — Fixed in R1 commit 9312eb83d. Promoted per the Decision gate (in-scope + fix is known). Source and all three compiled outputs updated.
  • NON-BLOCKING (Notion link fragility) — Declined with rationale: the in-repo policy section is self-contained — the four-bullet operational policy in the rule body is the load-bearing form. The Notion link is supplementary deep-dive (3 architectural shapes, decision drivers, risk register, implementation plan). Existing rule-corpus pattern is to link to Notion / memories for context; mirroring would create a sync hazard between the rule body and the Notion page. If Notion access becomes a long-term issue, the right fix is a separate ADR-mirroring task across all rule cross-references, not piecemeal mirroring in this rule.
  • NON-BLOCKING (.cursor/rules/ missing generated-file banner)* — Declined for this PR scope. The banner-emission gap is a compile-pipeline issue, not a content issue with this rule change. Filed as mt#1798 to fix the rules compile --target cursor-rules writer so it emits the banner uniformly, then update the check-generated-file-edit.ts hook's banner-matching if needed. Tracked separately to keep this PR's diff focused on the policy change.

Acceptance against the spec

Criterion Status
#1: Rule corpus contains a section that names the policy in operational terms ✓ — three bullet partitions (durable / ephemeral / inside-skill-chain) with concrete examples
#2: Rule explicitly states behavioral discipline for harness reminders during a skill chain ✓ — "disregard silently; do NOT echo acknowledgment text" with the rationale (harness reminder is invisible to user; echoing makes harness noise into chat noise)
#3: CLAUDE.md and AGENTS.md regenerate from source with banner intact ✓ — rules compile ran for all three targets; pre-commit hook confirms "All rules compile outputs are up-to-date"; banner still at line 1 of CLAUDE.md/AGENTS.md (cursor-banner gap is mt#1798 territory)
#4: Rule cross-references the Notion paper and mt#1316 ✓ — Notion paper linked inline in Generic-SE override AND in Cross-References; mt#1316 referenced in Pattern note AND in Cross-References
#5: Worked example shows the partition in action ✓ — contrasts /implement-task mt#X (no TaskCreate, ignore reminder) vs. "look into the duplicate session-cleanup edge case I keep seeing" (TaskCreate appropriate for diagnostic checklist until task is filed, then drop)

Why this rule belongs in decision-defaults

The decision-defaults rule corpus is explicitly described as: "REQUIRED policy corpus that overrides generic-SE defaults with Minsky-grounded answers". The agent-todo question fits this shape exactly:

  • Generic-SE default: use the harness's todo system for all task tracking (or use no task tracking at all)
  • Minsky-grounded answer: durable→Minsky task / ephemeral→harness todo / inside-skill-chain→neither, with the reminder-disregard discipline

The other sections in this rule corpus (Datastores, Reliability, Thresholds, User does not review PRs, Build vs buy, Multi-step direction execution) have the same shape. Cohesion argues for placement here rather than a separate rule file.

Concurrency analysis

(N/A — no check-then-act pattern introduced. Pure documentation/rule policy change.)

Live verification

The change is documentation/policy. The behavioral discipline ("disregard the reminder silently") is observable in future conversations but does not require live external systems to verify. The mechanical correctness — that rules compile regenerates the consumer files with the new section — is verified by:

  • grep -c "Agent todos vs. Minsky tasks" CLAUDE.md AGENTS.md → 5 each
  • grep -c "Worked example" CLAUDE.md AGENTS.md → 1 each
  • grep -c "mt#1316" CLAUDE.md AGENTS.md → 3 each
  • grep -c "mcp__minsky__tasks_create" CLAUDE.md AGENTS.md .cursor/rules/decision-defaults.mdc → 1 each (R1 tool-naming fix applied)
  • Pre-commit hook's "Checking rules compile outputs are up-to-date" check passes for all three targets

Documentation impact

The rule corpus IS the documentation. CLAUDE.md and AGENTS.md regenerate from it; this PR includes those regenerated outputs. The Notion position paper (already published, linked) provides the long-form analysis. No other docs (architecture.md, theory-of-operation.md, CONTRIBUTING.md, README.md) need updating for this policy.

Related

  • Notion paper: https://www.notion.so/35e937f03cb4812e9734f0c0f9a8b26c
  • mt#1797 — deferred Shape C tracking task (harness-agnostic working-notes surface)
  • mt#1798 — follow-up filed from R1: emit generated-file banner at line 1 of .cursor/rules/* outputs
  • mt#1316 (DONE) — structurally equivalent first instance of this shape (Asks ↔ MCP elicitation)
  • mt#1478 — Auto-mode skill chaining (adjacent; reinforces skill-chain default behavior)
  • mt#1678 (DONE) — original direct-edit-to-generated-output incident (the regression class R1's BLOCKING guards against)
  • mt#1699 (DONE) — check-generated-file-edit hook infrastructure
  • Claude Code Issue #26038 (open FR) — disable TaskCreate reminders without disabling tools
  • Claude Code Issue #6760 (open FR) — make TaskCreate swappable for an MCP backend (Shape C enabler)
  • Originating memory: feedback_agent_todos_vs_minsky_tasks (id 94c6eb16-7bde-4576-acaa-fabf87df708d)

… B policy)

Encodes the Shape B policy decision from the Notion paper "Position: Agent
todos vs. Minsky tasks — the durable/ephemeral boundary in the orchestration
domain model" (2026-05-12).

The new section in .minsky/rules/decision-defaults.mdc partitions agent
tracking surfaces:

- Durable work → Minsky task (spec, status machine, audit trail, multi-backend)
- Ephemeral intra-conversation work → harness todo (TaskCreate, scratchpad)
- Inside a Minsky skill chain → neither (the Minsky task IS the todo)
- Harness TaskCreate reminder during a skill chain → disregard silently;
  do not echo acknowledgment text to the user

Originating incident: 2026-05-12 single-task Minsky skill chain
(investigate mt#1786 → DONE) where the harness TaskCreate reminder fired
12+ times and the agent visibly echoed "Ignoring harness reminder" each
time, making harness noise into chat noise.

Also adds:
- Pattern note framing this as the second instance of the
  "Minsky abstraction meets harness-native primitive" shape (mt#1316 was
  the first; both decompose into shapes A/B/C with the same decision drivers)
- Worked example contrasting in-skill-chain vs. pre-task-triage usage
- Cross-references to mt#1316, mt#1797 (deferred Shape C), Notion paper,
  and the originating feedback memory

Regenerated CLAUDE.md, AGENTS.md, and .cursor/rules/decision-defaults.mdc
from the updated source via `rules compile`. Memory entry
`feedback_agent_todos_vs_minsky_tasks` (94c6eb16) created as the
originating memory.
@minsky-ai minsky-ai Bot added the authorship/co-authored Co-authored by human and AI agent label May 12, 2026
Copy link
Copy Markdown

@minsky-reviewer minsky-reviewer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent adversarial review (Chinese-wall)
Reviewer: minsky-reviewer[bot] via openai:gpt-5
Tier: unknown


The new policy section is well-framed and compiled correctly into CLAUDE.md and AGENTS.md, meeting the stated acceptance criteria. I found a blocking concern to resolve before merge: please explicitly confirm that AGENTS.md and CLAUDE.md were generated by the rules-compile pipeline (include the exact command and pre-commit output) to avoid any regression toward editing generated files directly. Non-blocking: align tool naming to the established mcp__minsky__* convention, consider mirroring the Notion link content in-repo for durability, and add a generated-file banner to .cursor/rules/decision-defaults.mdc so the edit-guard can protect it as well.

Findings

  • [BLOCKING] AGENTS.md:1 — Generated file edited directly? Verify compile pipeline source-of-truth alignment
    AGENTS.md carries the banner <!-- Generated by minsky rules compile. Do not edit directly. -->. The PR states these files were regenerated via bun src/cli.ts rules compile, which is correct. However, the diff shows large inserted sections in AGENTS.md and CLAUDE.md without an accompanying change in a source file would be suspicious. In this PR, the source .minsky/rules/decision-defaults.mdc did change, which justifies the regenerated outputs.

Blocking ask: Please confirm that these changes to AGENTS.md and CLAUDE.md were produced by running the compile pipeline and not edited manually. If compiled, add a one-line note in the PR description with the exact command run and the pre-commit check output (paste), or attach the pre-commit hook log. This ensures we don't regress on the previously documented incident (mt#1678) of direct edits to generated outputs.

  • [NON-BLOCKING] .minsky/rules/decision-defaults.mdc:90 — Inconsistent tool naming (tasks_create/tasks_status_set) vs. established mcp__minsky__* convention may confuse implementers
    In the newly added section §Agent todos vs. Minsky tasks, the durable-work bullet instructs to use tasks_create and tasks_status_set. Elsewhere in the docs, tool names are consistently fully qualified with the mcp__minsky__* prefix (e.g., mcp__minsky__session_pr_create, mcp__minsky__memory_search). Using unqualified names here creates ambiguity about whether these are skills, domain calls, or MCP tools.

Suggested fix: align naming to the established convention (e.g., mcp__minsky__tasks_create, mcp__minsky__tasks_status_set) or explicitly state that these are shorthand references to the Minsky MCP tools, to avoid misrouting by readers following the instruction literally.

  • [NON-BLOCKING] .minsky/rules/decision-defaults.mdc:96 — External Notion link included; consider cross-repo fragility and archival
    The new policy section links to a Notion document (https://www.notion.so/35e937f03cb4812e9734f0c0f9a8b26c). If access to Notion changes or the doc is moved, this becomes a dead reference in generated consumer files (CLAUDE.md, AGENTS.md, .cursor/rules/...).

Suggestion: add a short inline summary of the shape-decision drivers in this repo and/or mirror the Notion doc into an docs/ ADR-style file or a backups/ snapshot to ensure long-term accessibility.

  • [NON-BLOCKING] .cursor/rules/decision-defaults.mdc:1 — Missing generated-file banner in compiled .cursor/rules output weakens the edit-guard
    Unlike CLAUDE.md and AGENTS.md, the compiled .cursor/rules/decision-defaults.mdc does not include a Generated by ... Do not edit directly marker at the top. The check-generated-file-edit hook relies on banner markers to deny direct edits to compiled outputs. Absence here means edits to .cursor/rules/*.mdc won't be caught by the guard.

Suggestion: update the rules-compile pipeline to emit the standard banner at line 1 for .cursor/rules/* outputs as well, or add an equivalent recognizable marker so the guard can protect these files.

…ention

Reviewer-bot R1 NON-BLOCKING: §Agent todos vs. Minsky tasks used
unqualified tool names (`tasks_create`, `tasks_status_set`) inconsistent
with the established `mcp__minsky__*` convention used elsewhere in the
docs. Promoted to addressable per the Decision gate (in-scope + fix is
known).

Updated the durable-work bullet in .minsky/rules/decision-defaults.mdc;
regenerated CLAUDE.md, AGENTS.md, and .cursor/rules/decision-defaults.mdc.

Other R1 findings:
- BLOCKING (compile-pipeline evidence in PR body) → addressed by PR-body
  edit, not a code change
- NON-BLOCKING (Notion link fragility) → declined; the in-repo policy
  section is self-contained, the Notion link is supplementary deep-dive
- NON-BLOCKING (.cursor/rules/* missing generated-file banner) → declined;
  this is a `rules compile` pipeline change, out of scope for this PR.
  Separate task to be filed.
@minsky-ai minsky-ai Bot changed the title feat(mt#1796): decision-defaults rule: §Agent todos vs. Minsky tasks — durable/ephemeral boundary policy feat(mt#1796): decision-defaults §Agent todos vs. Minsky tasks — durable/ephemeral boundary May 12, 2026
Copy link
Copy Markdown

@minsky-reviewer minsky-reviewer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent adversarial review (Chinese-wall)
Reviewer: minsky-reviewer[bot] via openai:gpt-5
Tier: unknown


The prior BLOCKING concern about manual edits to generated outputs is addressed — CLAUDE.md and AGENTS.md clearly derive from the updated .minsky/rules/decision-defaults.mdc and carry the generated-file banner. The new policy section is present and compiled correctly; harness-reminder discipline is explicitly stated. I note two minor, non-blocking follow-ups: a lingering unqualified tasks_create reference in the worked example, and the absence of a generated banner in .cursor/rules/decision-defaults.mdc. Neither blocks merge. Overall quality is good; event is APPROVE.

Findings

  • [NON-BLOCKING] .minsky/rules/decision-defaults.mdc:1 — One lingering unqualified tool name in the worked example (tasks_create) — inconsistent with mcp__minsky__* convention used elsewhere
    In the new section §Agent todos vs. Minsky tasks, most tool names were updated to the fully qualified mcp__minsky__* convention (e.g., mcp__minsky__tasks_create, mcp__minsky__tasks_status_set). However, the final sentence of the worked example still says to "call tasks_create". This can confuse implementers reading the source file literally.

Suggested fix: change that instance to mcp__minsky__tasks_create in the source (.minsky/rules/decision-defaults.mdc) and re-run rules compile to propagate to CLAUDE.md and AGENTS.md. The compiled outputs will update automatically once the source is corrected.

  • [NON-BLOCKING] .cursor/rules/decision-defaults.mdc:1 — Compiled .cursor/rules/decision-defaults.mdc still lacks a generated-file banner at the top
    Per prior review, compiled outputs like CLAUDE.md and AGENTS.md include a banner <!-- Generated by minsky rules compile. Do not edit directly. --> that the pre-commit hook relies on to prevent direct edits. The compiled .cursor/rules/decision-defaults.mdc does not have any banner at the top.

Suggestion: update the rules-compile pipeline to prepend the standard banner (or a .mdc-appropriate marker) to .cursor/rules/*.mdc outputs so the generated-file edit guard can protect them as well. This is not blocking for this PR but reduces future edit safety for Cursor rule outputs.

  • [PRE-EXISTING] AGENTS.md:1 — Generated file edit guard satisfied — banner present at line 1; prior blocking concern addressed
    AGENTS.md and CLAUDE.md both start with the banner <!-- Generated by minsky rules compile. Do not edit directly. -->, and the corresponding source section in .minsky/rules/decision-defaults.mdc contains the new policy text that matches the compiled outputs. This verifies the outputs were regenerated via the compile pipeline, addressing the previous round's blocking ask about manual edits to generated files.

Spec verification

Criterion Status Evidence
#1: Rule corpus contains a section that names the policy in operational terms Met .minsky/rules/decision-defaults.mdc:76-101 — adds ## Agent todos vs. Minsky tasks with durable/ephemeral/inside-skill-chain bullets and examples; propagated to CLAUDE.md and AGENTS.md.
#2: Rule explicitly states behavioral discipline for harness reminders during a skill chain Met .minsky/rules/decision-defaults.mdc:92-96 — "When the harness emits a TaskCreate reminder during a Minsky skill chain → disregard silently. Do NOT echo acknowledgment text ..."; compiled into CLAUDE.md and AGENTS.md.

…ks_create in worked example

R2 NON-BLOCKING but in-scope per the Decision gate. R1 fixed the durable-work
bullet but missed a lingering unqualified `tasks_create` in the worked example
("call `tasks_create` to file the durable task"). The class-not-instance check
from §7's Convergence Checklist would have caught this in R1 — sweeping the
file for ALL unqualified `tasks_*` references rather than just the one the
reviewer flagged. Promoted to addressable here.

Updated source `.minsky/rules/decision-defaults.mdc`; regenerated CLAUDE.md,
AGENTS.md, and `.cursor/rules/decision-defaults.mdc`. All compiled outputs
now have 2 occurrences of `mcp__minsky__tasks_create` and 0 unqualified
`tasks_create` references.

Other R2 finding (`.cursor/rules/*` banner gap) remains tracked in mt#1798;
unchanged from R1.
Copy link
Copy Markdown

@minsky-reviewer minsky-reviewer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent adversarial review (Chinese-wall)
Reviewer: minsky-reviewer[bot] via openai:gpt-5
Tier: unknown


Verified that the previously blocking concern about generated outputs was addressed: both CLAUDE.md and AGENTS.md carry the generator banner and their content matches the updated source. The R2 non-blocking naming nit has been corrected — all references use mcp__minsky__tasks_create. The new policy section is present in the source and cleanly propagated to all compiled consumers, including cross-references and the worked example. I find no new defects introduced by this change. The only remaining gap is the known, pre-existing absence of a banner on .cursor/rules/*, which this PR intentionally defers (mt#1798). Event: APPROVE.

Findings

  • [PRE-EXISTING] .cursor/rules/decision-defaults.mdc:1 — Compiled .cursor/rules/* output lacks a generated-file banner
    Per prior iterations, .cursor/rules/decision-defaults.mdc does not include a Generated by ... Do not edit directly banner at the top, unlike CLAUDE.md and AGENTS.md. This weakens the edit guard enforced by check-generated-file-edit.ts. The PR explicitly defers this to mt#1798; leaving this as PRE-EXISTING/acknowledged for this PR, with no change requested here.

Spec verification

Criterion Status Evidence
#1: Rule corpus contains a section that names the policy in operational terms Met .minsky/rules/decision-defaults.mdc: adds section ## Agent todos vs. Minsky tasks: durable to Minsky, ephemeral to harness with durable/ephemeral/inside-skill-chain bullets. See the inserted block beginning at the new header and bullets in the diff and in-source: “Durable work → Minsky task…”, “Ephemeral, intra-conversation work…”, “Inside a Minsky skill chain → neither.”
#2: Rule explicitly states behavioral discipline for harness reminders during a skill chain Met .minsky/rules/decision-defaults.mdc: under the new section, explicit bullet: “When the harness emits a TaskCreate reminder during a Minsky skill chain → disregard silently. Do NOT echo acknowledgment text …” Propagated verbatim to CLAUDE.md and AGENTS.md in their new sections.
#3: CLAUDE.md and AGENTS.md regenerate from source with banner intact Met CLAUDE.md:1 and AGENTS.md:1 both begin with <!-- Generated by minsky rules compile. Do not edit directly. -->. The content of the new section matches the source .minsky/rules/decision-defaults.mdc additions, indicating proper compilation flow rather than manual edits.
#4: Rule cross-references the Notion paper and mt#1316 Met .minsky/rules/decision-defaults.mdc: Cross-References section at the bottom includes the Notion paper reference and mt#1316. Also mentioned inline in the new section’s Generic-SE override and Pattern note. Confirmed propagated to CLAUDE.md and AGENTS.md near the end Cross-References list.
#5: Worked example shows the partition in action Met .minsky/rules/decision-defaults.mdc: the “Worked example.” paragraph contrasts /implement-task mt#X (do not call TaskCreate; ignore reminder) vs. pre-task triage scenario that may use TaskCreate and then mcp__minsky__tasks_create when becoming durable. Propagated to CLAUDE.md and AGENTS.md.

Copy link
Copy Markdown

@minsky-reviewer minsky-reviewer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: decision-defaults §Agent todos vs. Minsky tasks — durable/ephemeral boundary

CI status: pass — 2/2 checks passed (build, Prevent Placeholder Tests; GitHub Actions only; Smoke is independent — see Smoke line below)
Smoke: skipped — docs/rule-policy change only. The behavioral discipline ("disregard the harness reminder silently") is observable in future conversations and not exercised by any CLI command. The mechanical correctness — rules compile regenerates the consumer files with the new section, byte-identical to a fresh compile — is gated by the pre-commit hook's Checking rules compile outputs are up-to-date step which the commit-time validation already confirmed.

Summary

4-file change: source rule (.minsky/rules/decision-defaults.mdc) plus three compile outputs (CLAUDE.md, AGENTS.md, .cursor/rules/decision-defaults.mdc). Adds the §Agent todos vs. Minsky tasks section encoding the Shape B policy from the Notion position paper. Compile-pipeline evidence already pasted into the PR body resolves the prior R1 BLOCKING concern about direct-edits-to-generated-outputs. R1/R2 follow-up on tool-naming convention (mcp__minsky__*) fully applied including the class-not-instance sweep. 0 BLOCKING / 0 NON-BLOCKING inline findings. The change is scoped tightly, the source-of-truth alignment is verifiable, and CLI behavior is unaffected.

Cross-cutting concerns

None. The section is self-contained under ## Decision Defaults and reuses the existing structural pattern (operational policy bullets + Generic-SE override + cross-references) the corpus already uses.

Spec verification

Task: mt#1796

Criterion Status Evidence
#1: Rule corpus contains a section that names the policy in operational terms Met .minsky/rules/decision-defaults.mdc:79-101 adds ## Agent todos vs. Minsky tasks: durable to Minsky, ephemeral to harness with four operational bullets (durable / ephemeral / inside-skill-chain / reminder-disregard). Propagated unchanged to CLAUDE.md and AGENTS.md (grep shows 5 occurrences of the section title in each).
#2: Rule explicitly states behavioral discipline for harness reminders during a skill chain Met .minsky/rules/decision-defaults.mdc:89"When the harness emits a TaskCreate reminder during a Minsky skill chain → disregard silently." with explicit rationale: "Do NOT echo acknowledgment text ... The user cannot see the reminder; making it visible by echoing turns harness noise into chat noise."
#3: CLAUDE.md and AGENTS.md regenerate from rule source with banner intact Met Three compile-target invocations (claude.md, agents.md, cursor-rules) all returned ✅ Success; banner <!-- Generated by minsky rules compile. Do not edit directly. --> still at line 1 of CLAUDE.md and AGENTS.md (verified in commit 573eaaf4f and unchanged in 9312eb83d/1e26480e0). Pre-commit hook's "Checking rules compile outputs are up-to-date" step passed (output in PR body).
#4: Rule cross-references the Notion paper and mt#1316 Met Notion paper linked inline in the Generic-SE override (.mdc:91) AND in Cross-References (:163). mt#1316 referenced inline in the Pattern note (:95) AND in Cross-References (:165).
#5: Worked example shows the partition in action Met .mdc:97 — contrasts /implement-task mt#X (no TaskCreate, ignore reminder) vs. "look into the duplicate session-cleanup edge case I keep seeing" (mcp__minsky__tasks_create appropriate for diagnostic checklist until task is filed, then drop).

Adoption sweep

Symbol / command Consumers found Classification
§Agent todos vs. Minsky tasks policy section Loaded into every agent context via the always-applied decision-defaults rule (consumed by all skills the agent invokes — verified by inspecting compile rules output's rulesIncluded list which always includes decision-defaults) Adopted
Memory entry feedback_agent_todos_vs_minsky_tasks (94c6eb16) Referenced from the rule's Generic-SE override line and Cross-References block Adopted
mt#1797 deferred Shape C task pointer Referenced from the deferred-follow-up paragraph in the new section Adopted (task exists in TODO with explicit activation criteria)
mt#1798 follow-up (filed during R1 review for cursor-banner gap) Referenced from the PR body, not the rule text Adopted (task filed)

No new public exports, CLI commands, MCP tools, hooks, or capabilities introduced — this is a pure rule/policy addition. The "consumers" of this rule are the agents reading the rule corpus.

Documentation impact

No update needed — this PR IS the documentation update. The rule corpus is the canonical source for agent behavioral policy; CLAUDE.md and AGENTS.md regenerate from it and ARE updated in this PR via the compile pipeline. The Notion position paper (already published, linked) provides the long-form analysis. No other docs (docs/architecture.md, docs/theory-of-operation.md, CONTRIBUTING.md, README.md) describe the agent-todo-vs-task boundary; no other doc updates are required.

(Had Claude look into this — AI-assisted review)

@minsky-reviewer minsky-reviewer Bot added the review:bot-approved Reviewer bot has approved this PR label May 12, 2026
@minsky-ai minsky-ai Bot dismissed minsky-reviewer[bot]’s stale review May 12, 2026 21:04

Addressed in commits 573eaaf9312eb81e26480 and via PR-body update: (1) BLOCKING compile-pipeline evidence pasted into PR body (commands run + full pre-commit hook output showing "Checking rules compile outputs are up-to-date" passed); (2) NON-BLOCKING tool-naming convention fully applied across the section including R2's class-not-instance catch in the worked example; (3) NON-BLOCKING Notion fragility declined with rationale in PR body; (4) NON-BLOCKING .cursor/rules/* banner filed as mt#1798 follow-up. Subsequent reviews on latest HEAD (1e26480) both APPROVED.

@edobry edobry merged commit 6f15015 into main May 12, 2026
2 checks passed
@edobry edobry deleted the task/mt-1796 branch May 12, 2026 21:05
edobry added a commit that referenced this pull request May 13, 2026
…ules/* outputs

## Summary

- Closes the protection-coverage gap surfaced by reviewer-bot during mt#1796 PR #1082 review (filed as mt#1798 follow-up): `.cursor/rules/*.mdc` compile outputs did NOT carry the `Generated by minsky rules compile. Do not edit directly.` banner that CLAUDE.md and AGENTS.md have, so the `check-generated-file-edit` PreToolUse hook (mt#1699) could not detect direct edits to those files.
- Banner is now emitted as a **YAML line-comment inside the frontmatter block, on line 2** — chosen because Cursor's `.mdc` parser is strict about line 1 being the `---` frontmatter opener (sources in spec). YAML `#` is a line-comment, invisible to Cursor's parser, and matched by the hook's existing `^\s*#\s*Generated by\b` regex — no hook code change required.

## Key changes

### Writers (class-not-instance: both targets that write `.cursor/rules/*.mdc`)

- `src/domain/rules/compile/targets/cursor-rules.ts` — legacy target reading `.minsky/rules/*.mdc` flat sources. Adds `GENERATED_BANNER` constant; `serializeRuleToMdc` inserts the banner immediately after the `---` opener.
- `src/domain/compile/targets/cursor-rules-ts.ts` — TS-first target reading `.minsky/rules/<name>/rule.ts` modules. Adds the same `GENERATED_BANNER` constant (with cross-reference comments to keep both in sync); `buildRuleMdc` post-processes `matter.stringify`'s output to inject the banner after the opening `---\n` (gray-matter has no comment-injection API).

### Regenerated outputs (47 files)

All `.cursor/rules/*.mdc` files in the repo were regenerated via `bun src/cli.ts rules compile --target cursor-rules` to pick up the new banner. They now have:

```
---
# Generated by minsky rules compile. Do not edit directly.
name: <rule-name>
description: ...
alwaysApply: ...
---
```

This is a one-time bulk re-emit; future compiles only touch files whose sources changed.

### Tests

- `src/domain/rules/compile/targets/cursor-rules.test.ts` — adds a `generated-file banner (mt#1798)` describe block with 3 tests: banner-on-line-2, banner-preserved-with-empty-frontmatter, banner-matches-hook-regex.
- `src/domain/compile/targets/cursor-rules-ts.test.ts` — adds a `generated-file banner` describe block with 3 tests mirroring the legacy writer's coverage.

The `banner matches the hook's regex` test is the load-bearing regression guard: it pins the banner format to `^\s*#\s*Generated by\b` so if either side (banner-emission or hook-detection) drifts, the test fails.

## Acceptance against the spec

| Criterion | Status |
|---|---|
| #1: Every `.cursor/rules/*.mdc` has `# Generated by minsky rules compile. Do not edit directly.` as line 2 | ✓ — verified by `for f in .cursor/rules/*.mdc; do sed -n '2p' "$f" \| <check>; done` returning empty (all 47 files match). Unit tests pin the invariant. |
| #2: Cursor's `.mdc` parser still loads the files correctly | ✓ — YAML structure unchanged from Cursor's perspective. Line 1 is still `---`, frontmatter fields (`name`, `description`, `alwaysApply`, `globs`, `tags`) parse as before. The `#` line is a YAML comment per YAML 1.2 spec, ignored at parse time. |
| #3: Banner detected by `check-generated-file-edit.ts` | ✓ — the hook's existing `^\s*#\s*Generated by\b` regex (line 85 of the hook) matches our banner. Verified by the `banner matches the hook's regex` test in both writer test files (regression guard). |
| #4: Regression test confirms banner present in all outputs after compile | ✓ — 6 new unit tests across both writers; plus the pre-commit hook's `Checking rules compile outputs are up-to-date` step verifies the staged compiled files match a fresh compile. |

## Concurrency analysis

(N/A — no check-then-act pattern introduced. Pure string-output change in two writer functions.)

## Live verification

Manually verified the banner shape on all 47 regenerated files. Confirmed:

- Line 1 of every file: `---`
- Line 2 of every file: `# Generated by minsky rules compile. Do not edit directly.`
- Line 3 onward: the existing frontmatter (`name:`, `description:`, etc.)

A future direct-edit attempt to any `.cursor/rules/*.mdc` via the Edit / Write / session_edit_file tools should now be blocked by `check-generated-file-edit.ts` with the standard denial message. This is exercised by the hook's own test suite (which I did NOT modify — the hook regex was already correct for `# Generated by`; verifying that pattern matches our banner is the regression guard's job).

## Documentation impact

No update needed — this is a pipeline-internal change. The banner string itself is documentation (advisory to readers that the file is generated). No external `docs/architecture.md`, `docs/theory-of-operation.md`, `CONTRIBUTING.md`, or `README.md` sections describe the banner mechanism in detail; the banner is self-documenting.

## Related

- mt#1796 (DONE, PR #1082) — surfaced this gap in R1/R2 reviewer-bot review
- mt#1699 (DONE) — `check-generated-file-edit` hook infrastructure (the banner-guard mechanism this PR fills the coverage gap on)
- mt#1678 (DONE) — original direct-edit-to-generated-output incident that motivated mt#1699
- Cursor `.mdc` parser strictness sources: [MDC Format Specification (DeepWiki)](https://deepwiki.com/fbrbovic/cursor-rule-framework/2.1-mdc-format-specification), [Cursor forum bug report #50379](https://forum.cursor.com/t/bug-rules-in-rules-folder-require-undocumented-mdc-format-and-special-save-process/50379), [github/spec-kit#669](github/spec-kit#669)

Co-Authored-By: minsky-ai[bot] <minsky-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

authorship/co-authored Co-authored by human and AI agent review:bot-approved Reviewer bot has approved this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant