Skip to content

docs(knowledge): record zsh scope, Pages and sub-issue branch rules - #813

Merged
ss-o merged 3 commits into
mainfrom
docs/agent-memory-moves
Oct 19, 2026
Merged

ss-o merged 3 commits into
mainfrom
docs/agent-memory-moves

Conversation

@ss-o

@ss-o ss-o commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves four verified rules that were only kept in agent memory into their knowledge owners. Closes #814.

  • knowledge/domains/zsh/scripting.md (delivered to .github/instructions/zsh/scripting.instructions.md):
    • zsh/parameters/avoid-special-name-collisions: even local path without assignment empties the command hash table when the caller's value is restored, so the next lookup rescans every PATH directory; local PATH does the same, while fpath, cdpath and manpath do not rescan.
    • zsh/cleanup/scope-traps: an EXIT trap set inside a function, anonymous ones included, runs when that function returns; whole-file cleanup traps go at the sourced file's top level.
  • knowledge/domains/zsh/index.md: the policy validator test command and its fast class.
  • knowledge/domains/ci/index.md: Pages uses build_type: workflow, so the source branch in its settings is inert and static.yml publishes.
  • knowledge/domains/governance/sub-issues.md (delivered to runbooks/sub-issues.md): file the repository sub-issue before naming the implementation branch, and name the branch after it, never after the organization parent.
  • automation/ci/test_validate_zsh_standard_policy.py: the frozen consumer-parser digest is updated for the scripting instruction change, as the test instructs (chore(ci): explain how to regenerate the frozen consumer-parser golden #588).

Verification

  • zsh 5.9.2: strace -f -e trace=getdents64 -c over f() { local path; }; : ${+commands[ls]}; f; : ${+commands[ls]} counts 86 calls, against 43 with local dir, local fpath, local cdpath or local manpath, and 86 with local PATH; f() { trap "print fired" EXIT; print in-f; }; f; print after prints in-f, fired, after.
  • gh api repos/z-shell/.github/pages: build_type is workflow, source.branch is metrics; static.yml deploys with pages: write.
  • python3 automation/knowledge/knowledge-delivery.py --check: 57 consumers checked. python3 automation/knowledge/knowledge-coverage.py: 366 files checked.
  • python3 automation/ci/validate-zsh-standard-policy.py: passed. cd automation/ci && python3 -m unittest test_validate_zsh_standard_policy: 111 tests OK. python3 -m unittest automation/agents/test_validate_agent_policy.py: 99 tests OK.
  • Trunk prettier reports the compact tables in knowledge/domains/*/index.md as unformatted; untouched index files report the same, so this is not new.

Agent handoff

No handoff needed.

Localizing path, PATH, cdpath, fpath or manpath empties the command hash table on return and forces a full PATH rescan; an EXIT trap set inside a function fires when that function returns. The zsh domain index names the policy validator tests, the CI index says static.yml publishes Pages (build_type workflow), and implementation branches are named after their repository sub-issue. The frozen consumer-parser digest is updated for the scripting instruction change (#588).
@ss-o
ss-o requested a review from a team as a code owner October 19, 2026 00:51
ss-o added 2 commits October 19, 2026 01:53
strace on zsh 5.9.2 shows a local path or PATH doubling the PATH directory scans (86 against 43 getdents64 calls), while a local fpath, cdpath or manpath does not rescan. The frozen consumer-parser digest follows the instruction change (#588).

@ss-o ss-o left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fallback review under ADR-0026: Copilot request not registered on ee32b0c

Findings

No actionable findings.

Scope: the full diff of 2c37bfe...ee32b0c (7 files: the scripting standard source and its delivery, the zsh and CI domain indexes, the sub-issues source and its delivery, and the frozen digest in test_validate_zsh_standard_policy.py). Needs meta:no-issue from the maintainer under ADR-0022.

Note

The maintainer elected this fallback after the Copilot request did not register (no review_requested event). It is a self-review by the authoring agent, not an independent review or approval to merge.

Validation

  • Passed: all PR checks on ee32b0c. Locally: knowledge-delivery.py --check (57 consumers), knowledge-coverage.py (366 files), validate-zsh-standard-policy.py, test_validate_zsh_standard_policy (111 tests), test_validate_agent_policy.py (99 tests).
  • Claims checked at source: strace on zsh 5.9.2 counts 86 getdents64 calls with local path or local PATH against 43 with local fpath, cdpath, manpath or dir; an EXIT trap set in a function fires on its return; gh api repos/z-shell/.github/pages reports build_type: workflow and static.yml deploys with pages: write.
  • Pre-existing: Trunk prettier reports the compact tables in knowledge/domains/*/index.md as unformatted, including untouched index files.
Checklist verdicts and supporting evidence
  • Documentation accuracy: pass after fixes. Self-review before posting corrected two of the author's claims: the rescan note first named cdpath, fpath and manpath too (5442fdc), and the validator time read "about two minutes" against 45 s measured (ee32b0c).
  • Generated ownership: pass. Edits are in the knowledge/domains sources; the delivered copies were regenerated and --check is clean.
  • Frozen digest: pass. Updated as the test's own message instructs for a scripting instruction change (#588).

@ss-o
ss-o merged commit cf85497 into main Oct 19, 2026
16 checks passed
@ss-o
ss-o deleted the docs/agent-memory-moves branch October 19, 2026 01:06
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.

[docs]: record zsh scope, Pages and sub-issue branch rules in knowledge

1 participant