Skip to content

feat(folders): folder-level additional steering directories, delivered for every provider - #11827

Merged
chenmingwei23 merged 1 commit into
kirodotdev:mainfrom
billygerhard:feat/folder-steering-paths
Sep 24, 2026
Merged

chenmingwei23 merged 1 commit into
kirodotdev:mainfrom
billygerhard:feat/folder-steering-paths

Conversation

@billygerhard

@billygerhard billygerhard commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

A sidebar folder can scope a project_dir (file search, @-mentions, and the project's own .kiro/steering), but there is no way to attach additional steering directories that live outside the project — e.g. a shared standards/planning repo that applies across many project folders. This is upstream issue #631 ("Folder-level rules/instructions and attached sources"), and the recurring IDE-"workspace-folders" ask (#4900, #7837). Users today must hand-edit an agent template's resources per repo, which is undiscoverable and does not inherit.

Why it matters

Anyone maintaining a shared standards/planning repo (steering, checklists, decision records) that applies across many project folders currently has no way to attach it in Crew: project_dir scopes only one directory's own .kiro/steering, so the shared rules must be duplicated per repo or wired by hand-editing an agent template's resources — undiscoverable and non-inheriting. This is a recurring, multiply-requested gap (#631 plus the workspace-folders asks #4900/#7837). Delivering it at the universal context seam also means every current and future backend — including config-authored harnesses — inherits the capability with no per-provider work.

What changed (motivation → approach → change)

A folder gains an Additional steering directory list, resolved up the folder tree and delivered to the model at session start — for every backend, not just one.

  • Universal delivery seam. Folder steering is read once (src/kiro_crew/folder_steering.py) and placed into session-start context by the Context_Builder, so kiro-cli, Claude Code, Codex, KAS, and any future config-authored harness all receive it identically. No per-harness wiring — the harness/runtime/slot layers carry no steering field, which avoids the "one hole per host" gap where a provider silently drops it.
  • Accumulative inheritance. Effective dirs are the root-first union up the parent_id chain, de-duplicated and cycle-guarded, matching the existing project-directory resolver's walk contract.
  • Live resolution. Resolved from the committed folder tree at each fresh session (and re-injected after compaction), keyed off slot.folder_id — so editing a folder applies to existing chats at their next session, with no cached slot.steering_dirs.
  • Validation & safety. project_dir-equivalent validation (absolute, exists, 16-dir cap, sensitive-path rejection with SEL logging), re-validated on read, plus a defense-in-depth admissibility check in the Context_Builder. Files already loaded natively (project .kiro/steering, ~/.kiro/steering) are skipped to avoid double-injection.
  • UI. The folder dialog gains an "Additional steering" directory list (add via the existing picker, remove, inherited ancestor dirs shown read-only).

Tests

  • Backend: test_folder_steering.py, test_context_folder_steering.py, test_chat_folder_steering_dirs.py, test_chat_runner_folder_steering.py, test_harness_steering_invariant.py (property tests for the resolver + the identical-SpawnPlan invariant). 64 feature + 293 neighboring regression tests pass at -n 2.
  • Frontend: 77 vitest (FolderConfigModal + folderSteeringDirs), tsc/eslint/i18n clean, key added to all 14 locales.
  • black/isort/flake8/mypy clean on all touched Python.

Manual verification

Verified end-to-end on a pod: a chat filed into a folder with an external standards dir quoted a marker string and rule ID that exist only in that external directory; a chat outside the folder could not. Authored via the spec workflow (.kiro/specs/folder-steering-dirs/).

Screenshots / video

image

— PR #11827 UX evidence 2/2: Creating a child folder, showing the read-only "Inherited from parent folders" steering group — the second frame the UX Review asks for

pr11827-02-create-child-inherited-steering_8a7e5febbfa3497c8b7faf1e1caa4fcf

— PR #11827 UX evidence 1/2: Folder settings with the steering-directory list filled (two rows, each with × remove) — the "filled list" frame the UX Review asks for

pr11827-01-edit-steering-rows_d4813ec7c5dc4e8e90511277eca55120

Related Issues

Closes #631. Related: #4900, #7837.

@billygerhard
billygerhard requested review from a team and chenmingwei23 September 18, 2026 16:30
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention fork Pull request from a fork (external contributor) labels Sep 18, 2026
@dwu96

dwu96 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Why it matters

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 18, 2026
@billygerhard
billygerhard force-pushed the feat/folder-steering-paths branch from f95a43f to 22c0961 Compare September 18, 2026 16:43
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🟡 CONCERNS

Design-level review of 967f2ec13a40a26ebd44cd606adb8534fc5814fc via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

A stored steering root that vanishes or becomes refused drops out log-only: the modal still lists it and the prompt carries no omission notice.

Watch

The PR's own honesty principle ("a capped tree never reads like a complete one") stops at root granularity: every fired ceiling and the degraded fence get an in-band [FOLDER STEERING OMISSION: …] line, but a whole root skipped at read time — validate_file_path returning None ("folder steering directory refused or unresolvable", debug-level) or a silo-fence refusal at collect time — leaves nothing in the prompt and nothing in the UI. Consequence: an operator renames the standards repo (or it newly crosses a silo), every chat in the folder silently stops receiving the standards, while Folder settings keeps rendering the row as configured and the model sees a section indistinguishable from "this folder declares less". The omission machinery already exists; a skipped root is one more SteeringOmission kind, and the modal could surface stored-but-unresolvable rows.
Clears when: a read-time root skip emits an in-band omission notice (or the modal marks the row unresolvable), or the author states why silent root-level drop is intended.

[DESIGN-REVIEWED] 967f2ec

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — 🟡 CONCERNS

UX-level review of 967f2ec13a40a26ebd44cd606adb8534fc5814fc via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

"Add directory" opens a picker that speaks only "project" vocabulary, and no first-time reader has cold-read the new "Additional steering" section.

Watch

  • Picker vocabulary mismatch: the steering "Add directory" flow reuses ProjectPicker verbatim — its UI reads "Recent projects", "Path to project", "Project directory path" (ProjectPicker.tsx:365-368; the PR's own test targets that combobox for a steering pick). A user attaching a shared standards dir is told they're choosing a project, on every add on the feature's main path. Fix: pass a steering-mode label/placeholder variant when pickerTarget === 'steering'.
  • Silent no-op on duplicate pick: d.steeringDirs.includes(path) ? d : … closes the picker and adds no row — the user's explicit action produces zero visible change, reading as a failed add. Rare but confusing when hit; flash or scroll to the existing row instead.
  • No blind read is possible on a fork, so whether a newcomer parses "Additional steering" (Kiro jargon, softened only by the sibling "steering files" hint) is unverified — this lane's cap, not an author gap. A maintainer wanting the cold read can push the branch to this repo.

Suggestions

  • Extend the duplicate guard in FolderConfigModal.tsx's onSelect to also skip paths already in inheritedSteeringDirs, so one directory can't render twice (editable row + grey inherited row) in the same section.
  • Screenshots show the pre-final hint ("…in this folder."); shipped copy adds "and its subfolders" — recapture with capture-folder-steering.mjs so the evidence matches the shipped string.

[UX-REVIEWED] 967f2ec

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

Premise-level review of 967f2ec13a40a26ebd44cd606adb8534fc5814fc via the fork AI-review pipeline — 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

folder_steering.py ships test-shaped surface with zero real consumers — memory_silo_roots(), the home= parameter, and SteeringCollection's list-compat dunders.

Not justified as shipped

  • Item 10 — zero consumers: memory_silo_roots() is defined and never called (grepped memory_silo_roots\( across the whole patch: 1 hit, the definition — not even a test); collect_folder_steering(..., home=) is passed only by tests (both production call sites in context.py omit it, and its docstring says it "exists for the tests"); __getitem__/__eq__-with-list on SteeringCollection serve only test assertions like docs == [].
    Subtraction: delete memory_silo_roots (callers already use memory_silo_fence().roots), drop home= (tests monkeypatch Path.home), drop the list-compat dunders.
    Clears when: the deletions are made, or a non-test caller for each is named.
  • Item 4 — undeclared: the 403 steering_dirs_forbidden principal gate is never mentioned in the description; derived from the confused-deputy boundary, so inventory only.
  • Item 5 — undeclared: the memory-silo fence plus the config-loader change (malformed workspaces now preserved-degraded instead of repaired to {}, blocking all steering admission) is never mentioned; derived from the memory-store silo boundary.
  • Item 6 — undeclared: native Windows refuses/skips steering_dirs entirely; grounded in the existing pinned_fs.supports_pinned_tree_walk() rule the base already applies in snapshot.

What this change ships

Inventory (10 items, capped — plus i18n keys, a capture script among 609 siblings, an error-baseline bump) — 6 justified

Intent: let a folder attach shared, out-of-project steering directories that every chat filed under it inherits, on every backend — an ADDITION (issues #631, #4900, #7837).

  1. A folder can declare extra steering directories; their *.md reaches every chat in its subtree, on every provider — justified
  2. Folder settings modal gains the steering list (add via existing picker, remove, inherited shown read-only) — justified
  3. steering_dirs accepted on folder create/PATCH, [] clears — justified
  4. Apps and crew members get 403 when declaring steering dirs — undeclared (derived: read-laundering boundary)
  5. Roots touching memory stores refused; a malformed config workspaces table now recorded degraded, preserved, and blocks steering admission — undeclared (derived: silo boundary)
  6. Native Windows refuses/skips steering dirs — undeclared (derived: existing pinned-walk rule)
  7. Ceilings (64 docs / 4096 entries / char cap) reported in-band as omission notices, member-envelope fitting — justified
  8. Folder steering re-injected after provider compaction — justified
  9. Project/global .kiro/steering skipped only on providers that already deliver those trees — justified
  10. memory_silo_roots(), home=, list-compat dunders — zero consumers

[FIRST-PRINCIPLES-REVIEWED] 967f2ec

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review (fork) — ✅ no blocking findings

Reviewed 967f2ec13a40a26ebd44cd606adb8534fc5814fc via the fork AI-review pipeline; updated in place on each push.

Review details

Nothing blocks; the sharpest advisory issue is a TypeError escaping the new memory-silo fence, which fails the turn instead of degrading.

FINDING — src/kiro_crew/folder_steering.py:266 — candidates.extend(workspace_dir_from_entry(cfg.workspaces[name]) for name in sorted(cfg.workspaces)) is consumed in the else: clause, outside the try that only guards KiroCrewConfig.load(), and nothing coerces entry.dir (_migrate_workspaces stores WorkspaceConfig(dir=value.get("dir", "workspace")) verbatim and _apply_field_default is depth-capped at two segments), so a truthy non-string workspaces.<name>.dir in config.json makes Path(dirname) raise out of memory_silo_fence() → 500 on folder create/PATCH and a failed (not degraded) turn for every chat in a steering folder, contradicting chat_runner.py:10989's own "it must never fail the turn" → Fix: guard the new helper (dirname if isinstance(dirname, str) else WorkspaceConfig().dir in workspace_dir_from_entry) and wrap the await asyncio.to_thread(_resolve_folder_steering_dirs, …) in except Exception with the warning it already logs for _steering_err.

FINDING — src/kiro_crew/dashboard/chat_folders.py:701 — fence = memory_silo_fence() sits inside for entry in value:, and _resolve_folder_steering_dirs invokes _validate_steering_dirs([entry]) one entry at a time, so a full KiroCrewConfig.load() (deep copy plus whole-dataclass rebuild plus the three publish_* side effects) runs once per declared directory — on every turn of a V2 member chat, since _folder_steering_turn returns True for all of them → Fix: hoist the fence above the loop and have _resolve_folder_steering_dirs build one MemorySiloFence for the whole chain.

FINDING — src/kiro_crew/dashboard/chat_folders.py:711 — the read path reuses the write-site auditor, so once the workspaces table is degraded (the state this PR newly preserves instead of repairing) every member turn appends one operation="chat.folder_steering_dirs", outcome="denied", caller="dashboard" record per stored entry to the append-only SEL log, fabricating folder-write denials nobody made and burying the real ones → Fix: add audit: bool = True to _validate_steering_dirs and pass audit=False from _resolve_folder_steering_dirs, which already logs its own logger.warning.

[OPUS-REVIEWED] 967f2ec

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed 967f2ec13a40a26ebd44cd606adb8534fc5814fc via the fork AI-review pipeline; updated in place on each push.

Review details

FINDING -- src/kiro_crew/context.py:941 -- “render_essentials REFUSES … _MAX_DOCUMENTS” contradicts its character-only enforcement -> Fix: Attribute the document-count limit to callers. (origin: validation)
[GPT-REVIEWED] 967f2ec

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 18, 2026
@billygerhard
billygerhard force-pushed the feat/folder-steering-paths branch from 22c0961 to 1cb7de7 Compare September 18, 2026 17:16
@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 Sep 18, 2026
@billygerhard
billygerhard force-pushed the feat/folder-steering-paths branch from 1cb7de7 to 7ec8074 Compare September 18, 2026 17:32
@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 Sep 18, 2026
@billygerhard
billygerhard force-pushed the feat/folder-steering-paths branch from 7ec8074 to cd0bc49 Compare September 18, 2026 18:26
@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 Sep 18, 2026
@billygerhard
billygerhard force-pushed the feat/folder-steering-paths branch from cd0bc49 to 4380dd2 Compare September 18, 2026 19:27
@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on 96b8ebd50, fixed in 0c7c28430:

BLOCKING -- omission notices could push the bounded section past max_chars. Confirmed: the bounded renderer reserved the notices before spending on bodies but never bounded the notices themselves, so 16 roots x 200-char paths x two fired ceilings could return a section over the cap (the old "honest floor" arm returned the floor whole even when it exceeded the cap). Fixed with _fit_notices: notices that fit are kept whole; otherwise they collapse into ONE line naming how many were collapsed and that the standards are incomplete; if even that does not fit it is cut to the room left (module-owned text, nothing forgeable); and a cap that cannot hold the frame plus a minimal notice yields "" with a warning rather than an over-cap section a downstream trim would cut mid-sentence. The budget notice goes through the same fit when nothing could be admitted. Every returned section is now <= max_chars; pinned across caps 6000/2000/400/250/200 with 32 long-path notices (collapse observed at 2000, refusal at 160 and 10), plus a pin that notices which fit stay verbatim. Mutation-probed (disabling the collapse fails the cap pin).

FINDING -- function-local imports in memory_silo_roots. Moved KiroCrewConfig/config_dir/workspace_dir_for, WORKSPACE_DIR_NAME and MEMORY_STORES_DIR_NAME to module scope; none of those modules import folder_steering, so there is no cycle, and the suites import cleanly.

Also on 96b8ebd50: the other 66 settled lanes were green; 17 were still running at push time.

@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on 0c7c28430, fixed in 68e67a788:

BLOCKING -- alternate-case path bypasses the memory-silo fence on a case-insensitive filesystem. Confirmed: crosses_memory_silo compared Path.resolve() output byte-exact, and resolve() does not canonicalize case, so on macOS APFS/HFS+ (or Windows) .../Workspace named the same directory as the fenced .../workspace and walked past. Fixed the way is_sensitive_path already handles the same class: both sides are casefolded before the equality / both-way containment test. Strictly more protective on case-sensitive Linux (it can only over-refuse an alternate-case sibling of a silo). Pinned on the pure predicate -- alternate-case spellings of the silo, inside it, over it, and inside the named-store tree are all refused; longer sibling names (workspace-notes, WorkspaceX) are not prefix-matched in either case. Mutation-probed (byte-exact compare fails the pin). providers.md notes the casefolded comparison.

@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on 68e67a788, addressed in 4613f4608:

BLOCKING -- entry-ceiling notice states a fabricated exact count. Partly confirmed. The count itself is not fabricated: it is the one directory mid-listing when the ceiling fired, plus every sibling still queued at every open level, plus every child that could not be opened -- all directories the walk demonstrably never listed. But it IS a lower bound (an unlisted directory's own subtree was never seen, so it cannot be counted), and the notice rendered it as if exact. Fixed at the notice, not the count: it now reads "at least N directory(ies) ... were not listed ... The count is a lower bound: an unlisted directory's own subtree was never seen." The SteeringOmission docstring says the same. The 4097-entry example yields "at least 1", which is the honest statement (one directory, the root, was not listed to completion; what lies beneath its unlisted entries is unknown).

BLOCKING -- channel folder behaviour documented incorrectly. Confirmed, and my previous wording was wrong in the other direction. Verified in source: dashboard/channel_slots.py surfaces Slack, Discord, Telegram and Teams conversations as dashboard slots bound by linked_session_key, and the reconciler / channel auto-filing sets slot.folder_id on them. A turn typed in that slot's dashboard TAB runs through the dashboard chat runner on the linked channel session and DOES receive the folder's steering (the runner resolves slot.folder_id); a turn arriving FROM the channel side goes through messaging/dispatch.py with slot=None and does not. The feature-map row now describes exactly that asymmetry. Whether channel-side turns should also inherit is a product question outside this PR's intent; the row no longer claims either way beyond what the code does.

Also on 68e67a788: Backend Tests (3.12, 1) = the test_pdf_extract xdist worker crash (#13030; fix PR #13124 is green and pending merge) and Backend Lint = a runner shutdown (exit 143) mid-black, not a formatting failure. This head is rebased onto main and carries the four flake fixes merged since (#13121, #13123, #13125, #13126).

@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on 4613f4608, fixed in 024c5d0b3:

BLOCKING F2 -- a full essentials envelope silently loses folder steering. Confirmed: when a member's own essentials occupied every document slot (or nearly every character), _fit_folder_steering_into_envelope returned [], so the replacement envelope -- which declares itself the complete replacement for all prior snapshots -- carried no trace that the folder's rules exist. Two changes: (1) the omission NOTICE may take one slot past the document-count room, because that ceiling is enforced by member_essential_context on the member's OWN declared essentials and the renderer enforces only the character bound -- folder documents still respect the count room, only the notice is exempt; (2) when the full notice's characters do not fit either, a minimal fixed line ("this folder declares steering that does not fit ... none of it is loaded") is tried before giving up. Pinned on the fit helper with derived budgets: 64 own documents -> notice present with the count; characters nearly exhausted -> full notice; room for 181 but not ~200 chars -> minimal notice; room under 181 -> [] with the warning. Both halves mutation-probed.

F1 (app-owned folder reads host Markdown into that app's own slots) is the fifth spelling of a finding rebutted in the dispositions for 5786078151 and earlier; the delivery gate routes an app-owned folder's steering only to that app's own slots, which the adjudicator's own fence note restates. No change.

Head is rebased onto main and carries all six flake fixes (#13121-#13126, all merged).

@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on bce027677, fixed in fb2d571b7:

BLOCKING F1 -- inherited steering list ignored principal filtering. Confirmed: the backend delivery gate skips an ancestor whose owner_app is non-empty and differs from the chat's principal, while resolveFolderSteeringDirs collected every ancestor's steering_dirs regardless of owner, so a person-owned child under an app-owned parent listed the parent's directories under "Inherited" although none of them would ever reach that folder's chats. Fixed at the resolver: resolveFolderSteeringDirs(folders, folderId, principal = '') applies the same rule as the backend (owner && owner !== principal -> level skipped; the person's folders, which carry no owner_app, stay in effect for every principal). The modal passes the folder's own owner_app in edit mode and the empty string when creating (a folder created from this dashboard is the person's). ChatFolder.owner_app added to the client type -- the field already reached the client. Pinned at the resolver (person / app / member / empty-string-owner shapes) and in the modal (foreign-principal ancestor not listed; same-principal ancestor listed; group absent when every contributing ancestor is foreign); mutation-probed -- removing the filter fails 6 pins. The feature-map row now states the filter alongside the read-only claim.

@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on ab4681cbd, fixed in a25110b6d:

BLOCKING F1 -- a degraded workspaces table silently narrowed the memory-silo fence to the defaults. Confirmed: memory_silo_roots() swallowed a failed load and, on the two loader paths that hand back defaults without raising (an unparseable config.json, a non-object workspaces value -- the latter was also being REPAIRED to {} by schema validation before the loader ever saw it), built the fence from the default directories alone, so a steering root that merely contained an operator's external V1 workspace was admitted and read. Fixed in the repo's existing fail-closed pattern, both halves: (1) workspaces joins _FAIL_CLOSED_PATHS so a malformed table is preserved rather than repaired, and the loader records DEGRADED_WORKSPACES (new key beside DEGRADED_TAILSCALE); (2) memory_silo_fence() returns roots plus a degraded reason (load raised / DEGRADED_WHOLE_CONFIG / DEGRADED_WORKSPACES), the validator refuses every admission while the fence is incomplete (SEL-audited; clearing to [] still works), the collector reads nothing and emits an in-band [FOLDER STEERING OMISSION: ... memory-store fence is incomplete ...] line with a warning naming the repair, and crosses_memory_silo() with no explicit silos answers True for every root on a degraded fence. Pinned in test/test_folder_steering_fence.py (three degraded shapes at admission, the collector, the predicate, the loader marker, and an intact-config control); mutation-probed -- dropping workspaces from the registry fails the loader pin, dropping the collector's refusal fails the collector pin. Documented in providers.md.

F2 -- document-ceiling notice overclaimed. Reworded: "N more Markdown file(s) under were not examined -- the 64-document ceiling was reached, so whether they hold steering is unknown", since candidates past the ceiling are never opened. Pins updated.

@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on a25110b6d, fixed in 7a02706a6:

BLOCKING F1 -- the project/global steering dedup assumed every provider delivers those trees. Confirmed: _double_load_roots skipped any document under <project>/.kiro/steering or ~/.kiro/steering unconditionally, while the compensating delivery exists only for kiro-cli (native --agent resources), the Claude Code seam (the explicit [Steering resources] load, gated on is_cc) and KAS (native_steering); Codex and the other harnesses have no such path, so a folder declaring one of those trees delivered nothing there. Fixed at the seam: collect_folder_steering(..., skip_delivered_roots=) and a _project_steering_delivered(provider_type, native_steering) predicate in context.py that names exactly the three delivering paths; both non-member call sites pass it, so Codex/OpenCode/Pi/Goose/DeepSeek receive the trees through the folder and the three delivering providers still skip them. Pinned in test/test_folder_steering_provider_dedup.py (predicate table, collector both ways, Codex builder receives project+global rules, kiro-cli/Claude Code builders do not receive them twice); mutation-probed -- forcing the predicate true fails 4 pins. Feature-map row and providers.md now state the provider-aware rule instead of "identically on every provider".

Also on this head: Linux shard 2 red was mine -- test_config_module_boundaries pins the loader's re-export snapshot from config.resolution, and DEGRADED_WORKSPACES had joined it. The loader now reaches it as _resolution.DEGRADED_WORKSPACES (the existing precedent) and consumers import it from config.resolution directly.

@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on 7a02706a6, fixed in 96450dfbb:

BLOCKING F1 -- the entry-ceiling notice reported a placeholder count and the wrong kind. Confirmed: past _MAX_FOLDER_STEERING_ENTRIES the classifier returned a bare None, discarding the files and subdirectories it had already listed, and the caller recorded a hardcoded count=1 of kind entries -- so a root of 4096+ Markdown files rendered as "at least 1 directory(ies) not listed". Fixed at the seam: _classify_entries returns (files, subdirs, examined, overflowed) and stops reading at the ceiling; _enter tallies the discarded files and subdirectories; one _ceiling_omissions helper (both the root-level and the child-level arm) emits an entries notice counting the directory the ceiling fired in + its listed-but-unentered subdirectories + every queued sibling + unopened children, and a separate new files notice ("N Markdown file(s) under were listed but not read -- the 4096-entry ceiling was reached while listing their directory") whenever Markdown was discarded. Pinned in test/test_folder_steering_entry_overflow.py (Markdown-only root reports files=ceiling and directories=1; subdirectory-only root reports directories=1+ceiling and no files line; the files line names the entry ceiling, not the document ceiling); mutation-probed -- restoring the placeholder fails 2 pins. The pre-existing gives-up pin was made kind-specific since listing order is filesystem-defined. providers.md updated.

@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on 96450dfbb, fixed in 2ec4ce3b5:

BLOCKING F1 -- feature-map row overstated delivery for Temporary private-member chats. Confirmed: the member seam gates folder steering on not blocks_reads, and blocks_reads is forced true in Temporary memory mode, so a private-member chat in that mode receives no folder steering -- consistent with how that mode already withholds the member's project documents (documents_for_member(include_project=not blocks_reads)), while a non-member Temporary chat still receives it. The row and providers.md now state that exclusion explicitly beside the other exclusions (Windows, channel-side dispatch, principal scoping). Pinned in test/test_folder_steering_temporary_mode.py: a Temporary member turn carries no folder rule (with a persistent-member control that does), a Temporary non-member turn does. Rebased onto main (+2).

@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on 5e747a398, fixed in 56618ff78:

BLOCKING F1 -- folder permission granted host-file reads. Accepted the proposed fix: only the person may declare steering directories. _refuse_principal_steering_dirs runs at BOTH write sites (POST /api/chat/folders, PATCH /api/chat/folders/{id}) before any path is validated or touched -- a non-empty steering_dirs from an app or crew-member principal is refused 403 steering_dirs_forbidden and SEL-logged as denied (source=app_isolation); clearing to [] stays allowed for every principal since it only removes reads; the person's own calls (empty principal) are unchanged, and a person-declared list on an app- or member-owned folder still routes to that principal's chats through the existing delivery gate. Pinned in test/test_folder_steering_principal_gate.py (app refused on create and on its own folder, member refused, refusal precedes path validation, app may still clear, app create without the field unaffected); mutation-probed -- disabling the gate fails 3 pins. Feature-map row and config.md state the rule.

Also on that head: Backend Lint & Type Check died with exit 143 (runner shutdown signal mid-black), not a formatting failure; the ratchet passes locally and re-runs on this sha.

A sidebar folder can declare extra steering directories. Every dashboard
chat filed under it (or under a descendant folder) receives the
always-inclusion markdown from those directories as session-start context,
in addition to the project's own steering.

Delivery happens once, in the context builder, the one layer every
provider passes through: kiro-cli, Claude Code, Codex, KAS and any
config-authored harness receive it identically as prompt text. Harnesses,
SpawnContext and AcpRuntime carry no folder-steering field. The effective
directories are resolved live from the committed folder tree at every
fresh session and post-compaction reinjection turn, so a folder edit
applies to existing chats with no cache to invalidate.

Spec: .kiro/specs/folder-steering-dirs (requirements, design, tasks).
@billygerhard

Copy link
Copy Markdown
Contributor Author

Disposition for the GPT round on 56618ff78, fixed in 967f2ec13:

BLOCKING F1 -- the silo fence mixed config snapshots. Confirmed: memory_silo_fence() judged degraded on one KiroCrewConfig.load() but then resolved each workspace through workspace_dir_for(name), which re-loads the config per name and silently falls back to the base directory when that load disagrees -- so a concurrent config write or transient read failure between the reads could drop an operator's external workspace from roots while the fence still read complete. Fixed: the placement rule is factored out of workspace_dir_for into workspace_dir_from_entry(entry) (pure, no config read; workspace_dir_for now calls it after its own load, so the two cannot drift), and the fence resolves every workspace -- including the base directory -- from the ONE snapshot it already holds. Pinned in test/test_folder_steering_fence.py: exactly one load, the reload path monkeypatched to raise, and a snapshot whose second read would show no workspaces still fences the external directory; mutation-probed -- restoring the per-name reload fails the pin. The module docstring's "ONE config read" claim now holds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Folder-level rules/instructions and attached sources

4 participants