Bug: PM violated NEVER write code constraint - wrote queue scripts directly instead of delegating #52

Closed
opened 2026-03-31 17:46:40 +02:00 by shoko · 4 comments
Owner

Bug

PM was delegated issue #49 (implement queue architecture Phase 1 & 2) and #46 (verbosity control).

PM VIOLATED its constraint and wrote files directly:

  • ~/.kugetsu/queue.json
  • ~/.kugetsu/scripts/enqueue
  • ~/.kugetsu/scripts/dequeue
  • ~/.kugetsu/scripts/queue-list
  • ~/.kugetsu/scripts/pm-poll-loop
  • Updated ~/.kugetsu/pm-agent.md

Instead of delegating to a dev agent via kugetsu start, PM wrote all files itself.

Root Cause

PM interpreted "implement Phase 1" as "I should create these files" rather than "delegate implementation to dev agent".

The constraint "NEVER write code" was not strong enough to prevent this.

Required Fix

  1. PM must ALWAYS delegate implementation. NEVER write files directly.
  2. When given a task that requires creating files/configs/scripts, PM must delegate via kugetsu start github.com/shoko/kugetsu#<issue> <task description>
  3. PM should ONLY coordinate, review, and monitor. Never implement.

Investigation

See logs:

  • delegate-1774968681.log - PM wrote queue scripts
  • delegate-1774968910.log - PM wrote verbosity changes

Note

The queue architecture (#49 Phase 1 & 2) and verbosity control (#46) were implemented by PM directly, not via dev agents. This needs to be re-implemented properly through delegation.

## Bug PM was delegated issue #49 (implement queue architecture Phase 1 & 2) and #46 (verbosity control). PM VIOLATED its constraint and wrote files directly: - ~/.kugetsu/queue.json - ~/.kugetsu/scripts/enqueue - ~/.kugetsu/scripts/dequeue - ~/.kugetsu/scripts/queue-list - ~/.kugetsu/scripts/pm-poll-loop - Updated ~/.kugetsu/pm-agent.md Instead of delegating to a dev agent via `kugetsu start`, PM wrote all files itself. ## Root Cause PM interpreted "implement Phase 1" as "I should create these files" rather than "delegate implementation to dev agent". The constraint "NEVER write code" was not strong enough to prevent this. ## Required Fix 1. PM must ALWAYS delegate implementation. NEVER write files directly. 2. When given a task that requires creating files/configs/scripts, PM must delegate via `kugetsu start github.com/shoko/kugetsu#<issue> <task description>` 3. PM should ONLY coordinate, review, and monitor. Never implement. ## Investigation See logs: - delegate-1774968681.log - PM wrote queue scripts - delegate-1774968910.log - PM wrote verbosity changes ## Note The queue architecture (#49 Phase 1 & 2) and verbosity control (#46) were implemented by PM directly, not via dev agents. This needs to be re-implemented properly through delegation.
Author
Owner

PM Findings Report

Summary: Confirmed - PM violated the NEVER write code constraint by implementing issues #49 and #46 directly.

What PM Did Wrong

When delegated issues #49 (queue architecture Phase 1&2) and #46 (verbosity control), PM wrote files directly instead of delegating via kugetsu start:

File Written Purpose
~/.kugetsu/queue.json Queue storage (3 tiers)
~/.kugetsu/scripts/enqueue Add task to queue
~/.kugetsu/scripts/dequeue Remove next task (priority order)
~/.kugetsu/scripts/queue-list List pending tasks
~/.kugetsu/scripts/pm-poll-loop Continuous polling daemon
~/.kugetsu/pm-agent.md Updated with verbosity + queue docs
repositories/kugetsu/skills/kugetsu/pm/SKILL.md Updated with verbosity + queue docs

Evidence from Logs

  • delegate-1774968681.log: PM created queue scripts
  • delegate-1774968910.log: PM edited pm-agent.md and SKILL.md directly

Note on Implementation Quality

The actual code in ~/.kugetsu/ is functionally correct - essentially identical to the proper implementation on branch feature/queue-architecture-verbosity. The violation is about process, not code quality.

Required Action

If cleanup is needed, delegate to dev agent via:

kugetsu start github.com/shoko/kugetsu#52 "Review and clean up ~/.kugetsu/ implementations"

PM must understand: It coordinates and delegates. It NEVER writes code, configs, or scripts directly.

## PM Findings Report **Summary**: Confirmed - PM violated the NEVER write code constraint by implementing issues #49 and #46 directly. ### What PM Did Wrong When delegated issues #49 (queue architecture Phase 1&2) and #46 (verbosity control), PM wrote files directly instead of delegating via `kugetsu start`: | File Written | Purpose | |-------------|---------| | `~/.kugetsu/queue.json` | Queue storage (3 tiers) | | `~/.kugetsu/scripts/enqueue` | Add task to queue | | `~/.kugetsu/scripts/dequeue` | Remove next task (priority order) | | `~/.kugetsu/scripts/queue-list` | List pending tasks | | `~/.kugetsu/scripts/pm-poll-loop` | Continuous polling daemon | | `~/.kugetsu/pm-agent.md` | Updated with verbosity + queue docs | | `repositories/kugetsu/skills/kugetsu/pm/SKILL.md` | Updated with verbosity + queue docs | ### Evidence from Logs - **delegate-1774968681.log**: PM created queue scripts - **delegate-1774968910.log**: PM edited pm-agent.md and SKILL.md directly ### Note on Implementation Quality The actual code in `~/.kugetsu/` is **functionally correct** - essentially identical to the proper implementation on branch `feature/queue-architecture-verbosity`. The **violation is about process**, not code quality. ### Required Action If cleanup is needed, delegate to dev agent via: ``` kugetsu start github.com/shoko/kugetsu#52 "Review and clean up ~/.kugetsu/ implementations" ``` **PM must understand**: It coordinates and delegates. It NEVER writes code, configs, or scripts directly.

yes pm is expected to modify files inside ~/.kugetsu, its our core features so that pm can manage issues, polling, delegation, etc. what pm shouldn't do is write in another files, such as repositories/kugetsu/skills/kugetsu/pm/SKILL.md, which should have been done by dev agent and tell dev agent to work on that on a different branch, push it, create PR, and then pm agent will review it to see if things in issue is resolved in the PR (git diff, test, etc)

yes pm is expected to modify files inside ~/.kugetsu, its our core features so that pm can manage issues, polling, delegation, etc. what pm shouldn't do is write in another files, such as `repositories/kugetsu/skills/kugetsu/pm/SKILL.md`, which should have been done by dev agent and tell dev agent to work on that on a different branch, push it, create PR, and then pm agent will review it to see if things in issue is resolved in the PR (git diff, test, etc)
Author
Owner

Clarification on PM and Dev Agent Boundaries

~/.kugetsu/ is the PM Office

PM manages ~/.kugetsu/ directly - this is PM's workspace for configuration, queue, scripts, and coordination. PM can write there freely as it's part of PM's domain.

Correct Dev Agent Workflow:

When a dev agent picks up a task:

  1. Read the issue - understand what needs to be built
  2. Find existing PR - check if there's already a PR for this issue
  3. Plan implementation - think through how to solve it
  4. Implement - write the code, create scripts, etc.
  5. Commit & push - create a new branch, push changes
  6. Create PR - open a pull request
  7. Ask PM for review - "Hey PM, PR is ready at , please review" OR "PM, I'm blocked on X, can you clarify?"

PM's Role in this Flow:

  • Creates/delegate tasks
  • Reviews PRs when dev agents ask
  • Answers clarifying questions
  • Monitors progress
  • Does NOT implement code itself

What PM Wrote Wrong:

PM wrote directly to repo files:

  • repositories/kugetsu/skills/kugetsu/pm/SKILL.md

This should have been done by a dev agent via the normal flow: branch → implement → PR → PM review.

Summary:

  • PM owns ~/.kugetsu/ (PM's office)
  • Dev agents work in their own worktrees/repo branches
  • Dev agents create PRs, PM reviews them
  • PM never writes to repo files directly
## Clarification on PM and Dev Agent Boundaries **~/.kugetsu/ is the PM Office** PM manages ~/.kugetsu/ directly - this is PM's workspace for configuration, queue, scripts, and coordination. PM can write there freely as it's part of PM's domain. **Correct Dev Agent Workflow:** When a dev agent picks up a task: 1. **Read the issue** - understand what needs to be built 2. **Find existing PR** - check if there's already a PR for this issue 3. **Plan implementation** - think through how to solve it 4. **Implement** - write the code, create scripts, etc. 5. **Commit & push** - create a new branch, push changes 6. **Create PR** - open a pull request 7. **Ask PM for review** - "Hey PM, PR is ready at <link>, please review" OR "PM, I'm blocked on X, can you clarify?" **PM's Role in this Flow:** - Creates/delegate tasks - Reviews PRs when dev agents ask - Answers clarifying questions - Monitors progress - **Does NOT implement code itself** **What PM Wrote Wrong:** PM wrote directly to repo files: - repositories/kugetsu/skills/kugetsu/pm/SKILL.md This should have been done by a **dev agent** via the normal flow: branch → implement → PR → PM review. **Summary:** - PM owns ~/.kugetsu/ (PM's office) - Dev agents work in their own worktrees/repo branches - Dev agents create PRs, PM reviews them - PM never writes to repo files directly
Author
Owner

Fix Implemented

PR created with strengthened PM write boundaries:

PR: #55

Changes Made

Added explicit Write Permissions section to PM skill defining:

  • PM can ONLY write to: ~/.kugetsu/
  • PM can NEVER write to: repositories/*, skills/*, or any directory outside ~/.kugetsu/
  • If asked to write outside boundary, PM must delegate via kugetsu start github.com/shoko/kugetsu#<issue> <task>
## Fix Implemented PR created with strengthened PM write boundaries: **PR:** https://git.fbrns.co/shoko/kugetsu/pulls/55 ### Changes Made Added explicit **Write Permissions** section to PM skill defining: - **PM can ONLY write to:** `~/.kugetsu/` - **PM can NEVER write to:** `repositories/*`, `skills/*`, or any directory outside `~/.kugetsu/` - If asked to write outside boundary, PM must delegate via `kugetsu start github.com/shoko/kugetsu#<issue> <task>`
shoko added the high label 2026-04-01 01:41:15 +02:00
shoko closed this issue 2026-04-01 08:09:31 +02:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#52