Skip to content

fix(agent): re-govern crew-bound shared templates when the ceiling tightens - #18811

Merged
cruisercohen merged 2 commits into
mainfrom
fix/issue-9598
Oct 11, 2026
Merged

cruisercohen merged 2 commits into
mainfrom
fix/issue-9598

Conversation

@cruisercohen

@cruisercohen cruisercohen commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When the governance ceiling tightens, a shared agent template that a crew is bound to stops auto-approving the tools the ceiling now denies, as Kiro Crew's own specs and crew forks already do.

kiro-cli honours a spec file's allowedTools and autoApprove before Kiro Crew's PreToolUse gate. A ceiling move re-derives Kiro Crew's specs and re-filters forks, but a template made on the Agent templates tab, edited on the detail page, or published is filtered only when written.

Why it matters

A tightened ceiling should bind the next session. For a crew bound to a shared template it did not.

Not a goal

  • Specs no crew is bound to. That includes a template made on the Agent templates tab, left unbound, and started through spawn: it keeps the grants it was saved with. The spawn path is out of scope here, and governance.md says so.
  • Holding or refusing spawns of a non-fork spec at the spawn gate.
  • The KAS backend, which already re-filters against the live ceiling.

What changed (motivation → approach → change)

  • Root cause: the fork refresh iterates fork lineage, and publish clears lineage.
  • Change: _refresh_forked_templates_locked ends with _govern_bound_shared_specs, which runs the fork refresh's two passes (_apply_governance_passes) over every spec a crew in config.json binds, by stem or declared name, all claimants on a collision. It skips only the file another writer rewrites (_files_with_their_own_writer), and rewrites a file only when a pass removed something.
  • Retry: a bound template left unfiltered for a reason a retry can clear sets fork_refresh._shared_template_held. The rebuild folds it into its conductor hold, so the ceiling memo stays pending. Any read OSError holds, a denied read included: kiro-cli cannot load that file now, but loads its grants once permissions are restored, with no ceiling move to retry. So do a failed listing (iter_agent_spec_files_strict) and a refused regular file (a second hard link).
  • This head: an unreadable file holds whether or not a crew binds it (it may declare a bound name), and so does a config file the load could not read whole. Neither clears until it changes or reads. When the hold rests only on what the pass could not read, it records each file's inode, link count and mtime, the loader's config fingerprint, and the answer generation (_shared_template_hold_record). _reproject_holding_the_lock and retry_held_conductor_specs skip the rebuild while shared_template_hold_unchanged finds that answer current (and the last rebuild's, _rebuild_answer_generation), every file unchanged and still held, and a fresh config load still incomplete. The probe reads through the same fence, quietly; the memo stays pending. A new answer, an edited file, a removed link or a read that now succeeds rebuilds on the next tick. A conductor installer's hold (_conductor_installers_held), a raised write and a raised rebuild are retried as before. The boot, pending and retry warnings now name a shared template or a conductor spec.

Options considered:

  • Chosen: keep the hold and skip the rebuild while nothing it rests on has changed. It stays fail-closed and covers every unreadable-file cause.
  • Rejected: hold a refused file only when its stem is bound or a bounded head read declares a bound name. The head read opens an inode the fence refuses, and an I/O error would still churn.
  • Rejected: filtering at session start (as KAS does). kiro-cli reads the spec file itself, so that means rewriting a shared file on the spawn path and refusing the spawn when the rewrite fails, the spawn-gate posture listed under Not a goal. It would also close the unbound spawn path; that is the follow-up.
  • Rejected: pacing a held retry on a timer (_PROFILE_WATCH_RETRY_S; Design, First Principles). It rewrites kirocrew.json and the owned specs every interval for as long as an unrelated hard link stays, which nothing bounds. After a transient failure clears, it keeps the denied grant live for up to an interval. The probe rebuilds on the next poll, and only when a retry can land.
  • Kept (Design): one hold verdict, _conductor_spec_held; this head adds one predicate where the retry sites rebuild. A verdict returned from the rebuild cannot carry the deferred boot pass's hold, which lands after the rebuild returned.
  • Rejected earlier: a published_from marker, docs only, a fixed retry budget.

Backwards compatibility

Compatible: only grants the current ceiling denies are removed, only on crew-bound specs; nothing is written on an ungoverned host or when nothing is denied.

Removes user data, one way: a denied allowedTools entry or governed autoApprove list is dropped, not parked, so a later loosening does not restore it. Every writer of these lists already works this way. Reader paths are relative to the kiro_crew package.
Reader: dashboard/handlers/agent_templates.py:api_agent_templates -- crew page -- lists the file minus denied entries; test_a_bound_shared_template_is_re_filtered_after_the_ceiling_tightens
Reader: dashboard/agent_admin/agent_detail.py:api_agent_detail -- crew page -- shows the remaining grants; a re-add is filtered by the same ceiling on save
Reader: dashboard/handlers/agent_panel.py:api_agent_panel_publish -- crew page -- copies the filtered file
Reader: acp/client.py:AcpClient._spawn -- chat -- kiro-cli loads the filtered spec; a removed tool still runs through the PreToolUse gate

Tests

New on this head:

  • test_an_unrelated_hard_linked_file_holds_without_a_rebuild_per_poll (test_conductor_allowed_tools_survive.py): the real rebuild and hook with an unbound hard-linked notes.json. Four polls and a maintenance wake run one rebuild, the memo stays pending, and the poll after the link goes rebuilds and lands. test_a_malformed_config_overlay_holds_without_a_rebuild_per_poll does the same with a config.local.json that does not parse. Both fail on 91cf263 (... was rebuilt again). test_a_bound_template_made_unreadable_is_filtered_once_readable_again (mode 000, then restored) and test_a_spec_this_user_may_not_read_holds_until_it_reads fail on 3a41f42 (False is True).
  • test_agent_refactor_fork_refresh.py: ..._holds_and_the_probe_finds_it_unchanged (quiet probe; a new answer or removed link ends it), test_a_read_failure_that_clears_with_nothing_changed_on_disk_is_retried, test_a_file_held_unread_that_is_edited_is_retried, test_a_hold_no_file_marks_records_nothing_to_probe, test_an_unreadable_config_holds_until_a_load_reads_it_whole, test_a_conductor_installer_hold_is_rebuilt_even_beside_an_unchanged_template_hold, ..._still_rebuilds_when_the_answer_moved_mid_rebuild, test_the_boot_warning_names_a_shared_template_hold.

Earlier rounds: about forty tests pin the filter, the exemption, each hold cause, the strict listing and the config flags.

Locally: 164 related test files pass (6 test_agent_template_skills.py failures also fail on clean main here); boot smoke, mypy and linters clean.

Manual verification

N/A — unit coverage sufficient: real files, real rebuild and hook.

Related Issues

Fixes #9598

Pattern harvest

Rule candidate: review-prompt
Pattern: a fail-closed retry that rebuilds every tick while nothing can change.

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.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision d8aeff6815d5be6fdeda1800e1ca01684188f226 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 10, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

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

Design-Verdict: CONCERNS

One unreadable or hard-linked file anywhere in the agents directory holds the ceiling memo, even when no crew binds it. Only an operator's fix on disk clears it.

Watch

  • A stray file stalls the ceiling memo. The description says "an unreadable file holds whether or not a crew binds it (it may declare a bound name)". That means one unbound notes.json with a second hard link or mode 000 sets _conductor_spec_held. The memo then stays pending under every answer until someone removes the link or fixes the permissions. Meanwhile the boot, pending and retry warnings repeat, now worded so they could mean a conductor spec. Operators learn to ignore that warning, and it is the same one that reports a real conductor-spec hold. The probe stops the rebuild churn. It does not let the memo move past a file the pass has no reason to care about.
    Clears when: the hold is limited to what the pass actually needs, for example an unreadable file whose stem matches a bound name (a stat, not a read). Or the PR states which warning an operator sees and confirms nothing else waits on the memo while the hold stands.
  • Most of the code is hold machinery, and the main gap is still open. About 400 lines of hold record, probe, fingerprint and generation bookkeeping sit across agent.py, fork_refresh.py and loader.py. Each retry site now has to reason about _conductor_installers_held versus _shared_template_held. Meanwhile an unbound template started through spawn keeps its denied grants, which is listed under Not a goal. That spawn path is the same harm (Shared (non-fork) agent templates are not re-governed when the ceiling tightens #9598), and it can only be closed with the spawn-time filter this PR rejected. Two enforcement shapes for one invariant will drift.
    Clears when: a follow-up issue for the unbound spawn path is linked, saying whether the spawn-time filter will replace this pass's hold machinery or sit alongside it.

[DESIGN-REVIEWED] d8aeff6

Description read

[DESCRIPTION-READ] 9afd3e831b6b5b7dc411a1131ea286bb08d6ab7cc377ff52c67ea3f70ca834a5

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 10, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of d8aeff6815d5be6fdeda1800e1ca01684188f226 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The new strict spec listing re-implements a raising agents-dir walk that agent_discovery._iter_spec_entries already provides, and the two already match file suffixes differently.

Not justified as shipped

  • Item 6 — duplicate of src/kiro_crew/agent_discovery.py:1605 (_iter_spec_entries): the PR adds _listed_spec_files, described as "lets an OSError from the listing propagate". The existing walk already raises: "A directory that cannot be listed raises the OSError". I searched os.scandir across agent_discovery.py, agent_spec_format.py and agent.py and found 2 raising spec-dir walks. They already disagree. The new one matches suffixes with os.path.normcase(n).endswith(JSON_SUFFIX), which is case-sensitive on POSIX. The old one uses spec_suffix, which is case-insensitive everywhere. So on a case-insensitive macOS volume, Foo.JSON reaches one listing and not the other.
    Subtraction: delete _listed_spec_files and the strict= branch of _split_spec_files. Build iter_agent_spec_files_strict on _iter_spec_entries plus the existing JSON-twin shadow rule.
    Clears when: one raising scandir walk of the agents directory remains.

What this change ships

Inventory (8 items) — 7 justified

Intent: a tightened governance ceiling stops a crew-bound shared template from auto-approving tools the ceiling now denies (#9598). This is a FIX.

  1. Crew-bound shared templates lose denied allowedTools/autoApprove after the ceiling tightens — justified
  2. A failed shared-template filter leaves the ceiling pending and retries it — justified
  3. An unreadable, hard-linked or refused spec file holds the retry, bound or not — justified
  4. The retry is skipped while every held file and config file is unchanged — justified
  5. An unparseable config.local.json is now detected per load and holds — justified
  6. Agents-dir listing failures now raise instead of reading as an empty directory — duplicate of agent_discovery._iter_spec_entries
  7. The profile watch and a failed deferred fork refresh both keep the ceiling pending while a hold is set — justified
  8. Boot, pending and retry warnings now name what is held — justified

[FIRST-PRINCIPLES-REVIEWED] d8aeff6

Description read

[DESCRIPTION-READ] 481531a435a52b3ddb70da3b82a64d434ccd8985d18efe3a3c1c5d5b728dc540

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d8aeff6

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

@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 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] d8aeff6

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

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

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 10, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 10, 2026
@cruisercohen
cruisercohen marked this pull request as ready for review October 10, 2026 11:18
@cruisercohen
cruisercohen requested review from a team and KiroCrewCaptain as code owners October 10, 2026 11:18
@cruisercohen
cruisercohen enabled auto-merge (squash) October 10, 2026 11:18
@cruisercohen
cruisercohen force-pushed the fix/issue-9598 branch 4 times, most recently from 423538f to cf51b02 Compare October 10, 2026 12:31
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 10, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

When the governance ceiling tightens, this PR re-filters a crew-bound shared template's allowedTools and autoApprove so it stops auto-approving tools the ceiling now denies. The root-cause analysis looks right: publish clears fork lineage, so the fork-refresh governance pass never visited these specs. The new _govern_bound_shared_specs pass reuses the same governance passes under the spec lock. HOLD because this is permission and tool-approval governance code (allowedTools/autoApprove, the conductor-spec hold and the reproject_for_ceiling_change memo), which needs a maintainer's sign-off under the brief. Both whole-design lanes report CONCERNS on cf51b02 and neither has a disposition. Design notes that _specs_for sets the retry hold on any OSError from any file in the agents directory. So one permanently unreadable, unrelated file (for example root-owned) would keep _conductor_spec_held set and rebuild on every poll. First Principles notes _specs_for is a third name-to-spec resolver beside agent_spec_path and spec_by_declared_name, with different stem and ambiguity rules. Before this lands, please narrow the hold to OSErrors on files that actually match the bound name and reuse an existing resolver, or answer both items. Checks are green and base is main. — crew-pr-reviewer

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR re-filters allowedTools/autoApprove on crew-bound shared templates when the governance ceiling tightens. The root cause is right: publish clears fork lineage, so the fork-refresh pass never visited these specs. _govern_bound_shared_specs reuses the same two passes under the spec lock and writes only when something was removed. I checked the deny direction and did not find a path that keeps a denied grant in a JSON spec. The new retry hold has a regression. At src/kiro_crew/agent_materialization/fork_refresh.py:456, _specs_for sets unreadable = True on an OSError from ANY file in the agents directory, even when that file has nothing to do with the bound name. That sets _conductor_spec_held, and agent.py:3809 then skips its generation memo, so every distribution poll and hourly wake runs rebuild_agent_config_reporting. That rebuild rewrites the spec files kiro-cli watches, which is exactly what the memo's docstring says must not happen. One permanently unreadable unrelated file (for example a root-owned spec left by sudo kiro-cli) is enough to keep this going for the life of the process. Suggested fix: hold only for a transient error on a file whose stem matches the bound name, and skip-and-warn on PermissionError. You could instead resolve through agent_spec_path as First Principles suggests. Add a test showing that a permanently unreadable unrelated file does not keep the hold set. Both CONCERNS items on cf51b02 are still unanswered. — crew-pr-reviewer (deep re-check)

@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 10, 2026
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Oct 11, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 11, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 11, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 11, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 11, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR re-filters allowedTools/autoApprove on crew-bound shared templates when the governance ceiling tightens. The root cause is right: publish clears fork lineage, so the fork refresh never visited these files. Head 91cf263 fixes the PermissionError half of my change request: a denied read is warned and skipped, and test_a_spec_this_user_may_not_read_never_holds proves it for an unrelated file. The same regression is still reachable another way, though. In src/kiro_crew/agent_materialization/fork_refresh.py, _scan_agent_specs puts every file in the agents directory into retry when the fenced reader refuses it (_refusal_holds returns True for any regular file, so any second hard link counts) or when it hits any other OSError. _govern_bound_shared_specs then sets held = True whether or not that file claims a bound name. A hard-linked notes.json that no crew binds therefore keeps _conductor_spec_held set until a person removes the link. Until then, every distribution poll and profile-watch tick skips the generation memo (agent.py _reproject_holding_the_lock and reproject_for_profile_change) and reruns rebuild_agent_config_reporting. The only signal is a log WARNING, and prime_ceiling_projection's boot warning blames "a conductor spec", which is the wrong cause. Design Review raises exactly this on 91cf263, and its CONCERNS and First Principles' CONCERNS (unbound templates started through spawn are still unfiltered) have no disposition on this head. Suggested fix, which stays fail-closed: keep the memo held but skip the rebuild while nothing has changed, keyed on the generation plus a fingerprint of the held paths (path, st_ino, st_nlink, st_mtime_ns). Alternatively, hold a refused regular file only when its stem is a bound name or a bounded head read shows it declares one. Add a test where an unrelated hard-linked file runs several passes without triggering a rebuild, fix the boot warning's wording, and in the description name the unbound-template spawn path as out of scope. — crew-pr-reviewer (deep re-check)

A crew-bound shared template left unfiltered for a reason a retry can clear
holds the ceiling memo until a pass filters it, so the next poll or
maintenance wake retries it. A read this user is denied holds like any other
read failure: kiro-cli cannot load that file now, but loads whatever grants it
carries once its permissions are restored, and nothing moves the ceiling then.
The agents directory is read once per pass, however many crews are bound.

A hold that rests only on what the pass could not read (a hard link, an I/O
error, a failed listing, a config file its load could not read whole) cannot
clear until one of them changes or reads, so the pass records each file with
its inode, link count and mtime, the config fingerprint, and the answer
generation.
The ceiling hook and the maintenance wake skip the rebuild while that answer is
current and every recorded file is unchanged and still reads as held; the memo
stays pending. A conductor installer's hold is retried as before, and the boot,
pending and retry warnings name which kind of spec is held.
@cruisercohen

Copy link
Copy Markdown
Contributor Author

Thanks for the deep re-check. Every point is addressed on d8aeff6 (rebased on current main, still two commits). All checks are green.

1. An unrelated hard-linked file holds and rebuilds on every poll. I took your first suggestion, which stays fail-closed. The hold still stands, because an unread file may be the one that declares a bound name. What changed is that the rebuild is skipped while nothing the hold rests on has changed. When a pass holds only on what it could not read, it records the answer generation, each file's (path, st_ino, st_nlink, st_mtime_ns), and the loader's config fingerprint if a config file was unreadable (fork_refresh._shared_template_hold_record). _reproject_holding_the_lock and retry_held_conductor_specs skip the rebuild while shared_template_hold_unchanged finds all of these:

  • the same answer, which is also the last rebuild's (_rebuild_answer_generation);
  • every file unchanged and still held on a quiet re-read through the same fence;
  • any held config still unreadable.

The memo stays pending throughout. The re-read is needed because a cleared sharing violation or restored permissions change none of the four stat fields. A conductor installer's hold, a write that raised and a rebuild that raised are retried as before. I rejected the second suggestion (hold only a bound stem, or a file a head read shows declaring a bound name): the head read opens an inode the fence refuses, and an I/O error would still churn. test_an_unrelated_hard_linked_file_holds_without_a_rebuild_per_poll uses the real rebuild and hook: four polls and a maintenance wake run one rebuild, and the poll after the link is removed rebuilds and lands. It fails on 91cf263.

2. The boot warning blames a conductor spec. The boot warning, the pending warning and the maintenance-retry warning now say whether a crew-bound shared template or a conductor spec is held (_hold_cause, which reads a new _conductor_installers_held). Covered by test_the_boot_warning_names_a_shared_template_hold.

3. The lane findings.

  • First Principles, unbound templates started through spawn: out of scope. The description says so under Not a goal, and so does governance.md.
  • Design on 91cf263, the hold covering the whole directory: point 1. The compatibility list it could not see: the description now fits the 8000-byte capture and has four Reader: lines.
  • Later heads, each fixed with a test that fails first:
    • A malformed config.local.json rebuilt on every poll. It is now probed like a file: test_a_malformed_config_overlay_holds_without_a_rebuild_per_poll.
    • GPT: a denied read was skipped, so restoring the file's permissions after a tighten left the revoked grant live, with nothing to retry it. A denied read now holds, and the probe stops it from rebuilding on every poll: test_a_bound_template_made_unreadable_is_filtered_once_readable_again. This reverses the skip-and-warn from your earlier review. Skipping existed to avoid the churn, the probe now removes the churn, and skipping turned out to be a bypass.
    • GPT: a ceiling move during a rebuild could leave the owned specs derived under the older answer. The last rebuild's answer must now match: ..._still_rebuilds_when_the_answer_moved_mid_rebuild.
  • Advisory items still open:
    • A retry timer instead of the probe. It would rewrite kirocrew.json every interval for as long as an unrelated link stays, and delay the retry after a failure clears.
    • A single hold accessor. There is still one verdict (_conductor_spec_held). Having the rebuild return it would not work, because the deferred boot pass sets its hold after the rebuild has returned.
    • Limiting the hold to bound stems. That fails open for a file that claims the name by declaration. Nothing reads the memo except the hook's own rebuild gate, and no session waits on it.
    • The strict listing duplicating _iter_spec_entries. That walk is the cache fingerprint and is documented as a superset. The strict listing picks the roster's Path.glob set on purpose (test_the_strict_listing_selects_what_the_glob_does).
    • A follow-up issue for the spawn path is your call.

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When the governance ceiling tightens, this re-filters allowedTools/autoApprove on every spec a crew in config.json is bound to. The root cause is fixed: publish clears fork lineage, so the fork refresh never visited these files. Head d8aeff6 answers my change request from 91cf263. The hold still stands, so it stays fail-closed, but _held_rebuild_would_repeat and shared_template_hold_unchanged skip the rebuild while the generation, each held file's (inode, nlink, mtime) and its fenced re-read are unchanged. test_an_unrelated_hard_linked_file_holds_without_a_rebuild_per_poll proves one rebuild across four polls and a wake, and the boot, pending and retry warnings now name the real cause through _hold_cause. I tried to break it in four ways. Editing a held file through its other hard link changes mtime and triggers a rebuild. A ceiling change mismatches the generation and triggers a rebuild. A new claimant added under an unchanged generation behaves exactly as on main, where the memo also returns early. A denied read now holds instead of being skipped, which closes the restore-permissions bypass GPT found. I grepped for other readers of _projected_ceiling_generation and _conductor_spec_held: only the gateway maintenance retry reads them, so a held memo delays nothing else. That answers Design's stray-file concern. The unbound-template spawn path is now named out of scope in the description. Checks are green and the base is main. — crew-pr-reviewer (deep re-check)

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.

Shared (non-fork) agent templates are not re-governed when the ceiling tightens

2 participants