Skip to content

feat(agents): every conductor gets the work ledger from the shared base - #17992

Merged
iamwhatever merged 1 commit into
mainfrom
feat/17977-base-conductor-work-ledger
Oct 8, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
feat/17977-base-conductor-work-ledger

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A pipeline or security conductor's Dashboard tab shows its boards and tasks, because every conductor records its dispatched items in the work ledger.

Only kirocrew-conductor (and its kirocrew-ledger-conductor alias) mounted @kirocrew-work. kirocrew-pipeline-conductor and kirocrew-security-conductor are built from the same shared conductor base but called _conductor_mcp_servers(config) without work=True, so they wrote no work/recorded entry at all.

Why it matters

The Dashboard tab reads the workstreams fold, and that fold mints a board only from work/recorded entries. A pipeline or security conductor running a full fleet showed "No workstream yet": the reader could not see what was in flight, what each task cost, or what was waiting on them. Two conductors were inspectable through one read tool; the rest only by opening files on the host.

Not a goal

  • No new record field. Security severity and evidence stay in the security skill's own findings ledger; the ledger row holds item state only.
  • No rewrite of the pipeline or security SKILL.md procedures. Their own stores (pipeline queue + decisions.md, security scripts/ledger.py) stay as the detail behind each ledger row.
  • No change to the goal conductor's prompt; its charter already states the ledger flow.
  • User-made conductors such as crew-manager-conductor are not materialized by Crew. One picks this up only if it is built from this base.

What changed (motivation → approach → change)

Symptom: no board for pipeline/security conductors → cause: the shared base mounted kirocrew-work only behind a work=True flag that only the goal conductor passed → fix in the base, so every conductor gets it and no conductor is edited one by one.

  • _conductor_mcp_servers(config) mounts kirocrew-work unconditionally; the work parameter is removed and the docstring says why.
  • _conductor_shipped builds every conductor's grant tuple and always includes the new _CONDUCTOR_BASE_WORK_GRANTS (work_ledger_read, work_ledger_record). The goal conductor still adds work_ledger_rebuild and work_brief. work_report stays gated on every conductor: it writes into a parent's record.
  • _conductor_prompt appends one shared block, _CONDUCTOR_WORK_LEDGER_PROTOCOL, to the pipeline and security charters: create with a concrete acceptance, bind before seeding, the worker reports with work_report, the conductor gives the verdict and closes. _conductor_spec keeps _CONDUCTOR_SYSTEM_PROMPT as is, so the goal conductor does not carry the flow twice.
  • _SHIPPED_GRANT_HISTORY gains the two base verbs on the security conductor. The pipeline conductor already listed them from the release that once shipped them.
  • Decision record: Mingwei ruled on 2026-10-08 (Every conductor records its work in the work ledger, so its Dashboard tab is not "No workstream yet" #17977) that every conductor uses the work ledger, which reverses the feat(conductor): isolate the work-ledger flow in a kirocrew-ledger-conductor agent #9277 retraction. docs/request-for-change/rfc-conductor-work-ledger.md (v5) records it in §Agent spec changes, §Scope, the migration table and Q10, and its README row is updated. docs/system-specs/modules/pipeline-conductor.md, the security installer docstring and the feature-map row no longer say the server is not mounted.

Backwards compatibility

Compatible: every conductor spec gains a mount and two auto-approved conductor-owned verbs; nothing a spec accepted before is refused, and every grant still passes the governance ceiling filter.

Reader: src/kiro_crew/agent_materialization/conductor_agents.py:_conductor_mcp_servers -- entry: release -- its three callers (_conductor_spec, _install_pipeline_conductor_agent, _install_security_conductor_agent) are in this file and are updated; the private work keyword had no other caller (signature pinned in test_agent_refactor_contracts.py).

Tests

  • New test/test_conductor_base_work_ledger.py: for each of conductor, ledger-conductor alias, pipeline and security, the written spec mounts kirocrew-work, auto-approves both base verbs on allowedTools and the derived KAS rule, and keeps work_report gated. Pipeline and security prompts are exactly their charter plus the shared block (once); the goal conductor and alias prompts are their charter unchanged. A real-path test installs the pipeline conductor, runs goal, create, bind (conductor session) and report (worker) through the real api_work_ledger_record / api_work_report routes, and folds the recorded entries through the workstreams fold into one board with the done task.
  • Updated the pipeline, security, worker and allowed-tools-survive tests that pinned the old "not mounted" behaviour, the _conductor_mcp_servers signature in the surface inventory, and the spec-byte goldens for the pipeline and security files only (events and state digests unchanged).
  • Mutation check: removing the mount fails 9 tests, dropping the base grants fails 5, dropping the shared block fails 4, appending it to the goal conductor fails 2.
  • 1118 passed across 16 related test files at -n 2. black, isort, flake8, mypy (repo venv), the comment-history gate, docs lint and semgrep (semgrep/ + p/python, p/security-audit, p/secrets) are clean. scripts/local-gate.py --dry-run plans 1730 backend and 804 frontend files under -n auto, close to the full suite, so that run is left to CI.

Manual verification

N/A — unit coverage sufficient: the change is spec materialization plus the ledger routes and fold, all driven by the tests above.

Related Issues

Fixes #17977

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@chenmingwei23
chenmingwei23 requested a review from a team as a code owner October 8, 2026 03:59
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 01132a6b02231067748e34b9457146b53d3f5423 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

@chenmingwei23 overrode this lane for 01132a6b02231067748e34b9457146b53d3f5423 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

Design-level review of 01132a6b02231067748e34b9457146b53d3f5423 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Step 3 of the shared protocol says the child reports with work_report, but no pipeline or security child is told to, so those boards show tasks with no progress.

Watch

  • Step 3 of the shared protocol has no one to carry it out. The block says "The child reports against its item with work_report". But the PR leaves both SKILL.md procedures unchanged ("No rewrite of the pipeline or security SKILL.md procedures"). Pipeline workers are "the worker agent" the skill names, and security auditors, verifiers and fixers run under their own agents. None of those is required to be kirocrew-worker or to mount kirocrew-work. The result: each item is created and bound, then sits silent until the conductor closes it. The board exists, but it can't show "what was waiting on them", which is half the stated harm. The real-path test passes only because it calls api_work_report itself.
    Clears when: the protocol (or each skill's dispatch section) requires the child to be spawned as kirocrew-worker or seeded with the report contract, or the block is narrowed to conductor-only steps (create, bind, verdict, close) and the description says child reports are out of scope.
  • Two stores of item state with no rule for which one wins. The ledger row is recorded on top of the pipeline queue / decisions.md and the security scripts/ledger.py. The 1,200-line skill procedures never mention the ledger, while the prompt block says the ledger "is what the person's Dashboard tab reads". When the two disagree (say a claim is undone in the queue but the item is never closed in the ledger), the Dashboard shows a state the conductor no longer acts on.
    Clears when: each skill names the point in its own cycle where the ledger row's state is updated (claim/unclaim → create/close), so the two stores can't drift.

[DESIGN-REVIEWED] 01132a6

Description read

[DESCRIPTION-READ] fa8da046b3003ec5d893a29228633123812ee646cade7bf7eb659391e3ec56bf

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 01132a6b02231067748e34b9457146b53d3f5423 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 01132a6

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 01132a6b02231067748e34b9457146b53d3f5423: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 01132a6b02231067748e34b9457146b53d3f5423 — this comment is updated in place on each push.

Review details

Advisory only: the new ledger protocol tells the pipeline and security conductors their children will work_report, but those children can't.

FINDING — src/kiro_crew/agent.py:4949 — the protocol appended to the pipeline and security charters says "The child reports against its item with work_report". Their children don't mount @kirocrew-work: the pipeline skill dispatches an operator-chosen worker agent, and nothing in either skill seeds a work_brief/work_report contract. So every item these conductors bind gets no reports. Their work_ledger_read cycles come back empty, and once a worker ends, is_stale flags the item until the conductor closes it. → Fix: in step 3, say a child without @kirocrew-work is tracked from session_read_message and the skill's own store, and that the conductor writes the verdict and close from there. Or have the protocol tell the conductor to dispatch leaf items as kirocrew-worker and include the reporting contract in the seed.

[OPUS-REVIEWED] 01132a6

Verdict parsed from the review's SHA-scoped output markers for commit 01132a6b02231067748e34b9457146b53d3f5423.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 01132a6b02231067748e34b9457146b53d3f5423: <one-sentence reason>

The shared conductor base now mounts kirocrew-work unconditionally and
auto-approves the two conductor ledger verbs (work_ledger_read and
work_ledger_record) on every conductor spec. The pipeline and security
conductors also get one shared work-ledger protocol block appended to
their charters: create with a concrete acceptance, bind before seeding,
the worker reports with work_report, the conductor gives the verdict and
closes. The goal conductor's charter already states that flow and is
left unchanged.

Their dispatched items now write work/recorded entries, so the
workstreams fold mints a board for them. Their own stores (pipeline
queue and decisions.md, security findings ledger) stay as the detail
behind each ledger row. The conductor work-ledger RFC (v5) records the
ruling that reverses the earlier retraction.

Fixes #17977
@chenmingwei23
chenmingwei23 force-pushed the feat/17977-base-conductor-work-ledger branch from e274e70 to 01132a6 Compare October 8, 2026 04:17
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 8, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 01132a6: Maintainer decision on 2026-10-08 that every conductor uses the work ledger, reversing the #9277 retraction; this PR records it in rfc-conductor-work-ledger, but the lane reads RFC status from the base commit and cannot see the amendment.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@chenmingwei23 marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 01132a6b02231067748e34b9457146b53d3f5423.

Maintainer decision on 2026-10-08 that every conductor uses the work ledger, reversing the #9277 retraction; this PR records it in rfc-conductor-work-ledger, but the lane reads RFC status from the base commit and cannot see the amendment.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Oct 8, 2026
@iamwhatever
iamwhatever merged commit 8fe49bd into main Oct 8, 2026
102 of 103 checks passed
@iamwhatever
iamwhatever deleted the feat/17977-base-conductor-work-ledger branch October 8, 2026 05:54
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Every conductor records its work in the work ledger, so its Dashboard tab is not "No workstream yet"

2 participants