AGENT SKILL
pin-settings-defaults
Use when adding or changing declared settings defaults in the registry to prevent phantom drift on fresh installs. Ensures each default is a provenance-verified contract against the real vendored resolver and is pinned in a subprocess test.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pin-settings-defaults
- description
- Use when adding or changing declared settings defaults in the registry to prevent phantom drift on fresh installs. Ensures each default is a provenance-verified contract against the real vendored resolver and is pinned in a subprocess test.
03 SKILL.md 正文
Pin Settings Defaults Against Resolver
When
When declaring, fixing, or auditing settings defaults (e.g., in the pi registry) that feed a /settings diff report. Prevents 'phantom drift' where 8+ interface items falsely report as modified on a pristine install.
Steps
- Identify the Real Resolver: Locate the vendored settings-manager getter for each interface item. Do not derive defaults from UI selector row-states or component-local values; those are display states, not source-of-truth.
- Verify the Contract: For each declared default, assert that
resolver.get(item)returns the exact declared value on a pristine (out-of-the-box) environment. If they mismatch, the declared default is a bug. - Fix & Document: Update the declared default to match the resolver's output. Add a
// provenance: <getter-name>comment to every defaulted field to record which resolver value it was aligned with. - Pin in a Subprocess Test: Create
test/settings-defaults-drift.test.tsthat iterates all defaulted items and assertsget(item) === declared_default.- Critical: Run this test in a subprocess (e.g.,
execSync('bun test ...')). Do not run it in-process. Why: some settings getters resolve throughterm.ts's module-scopeUNOWN_HOMEsnapshot; in-process runs read earlier tests' environment leftovers, masking true drift.
- Critical: Run this test in a subprocess (e.g.,
- Add BM-8 Guard: In the bisect-registry guard, add a 'pristine home' check: run
/settings diffon a fresh home dir. The diff must reportNo settings differ. Any non-zero drift rows is a hard fail. - Handle No-Op Probes: If a test/probe sets a setting to its current value, it will produce zero detectable drift. Construct test targets as
current_value + offset. Add a load-time validation that flags any task whosediskCheck.expectequals the item's declared default asdiff-inert(honest no-op, not a failure).
Verification
test/settings-defaults-drift.test.tspasses in subprocess- BM-8 pristine-home guard reports 0 drift rows
- All defaulted fields carry provenance comments
04 同仓库更多 Skills
valid-skill
A valid skill for testing purposes.
★ 0
unknown-field
A skill with an unknown frontmatter field.
★ 0
nested-child
Nested skill should be ignored.
★ 0
root-skill-preferred
Root skill should win.
★ 0
no-frontmatter
暂无简介
★ 0
child-skill
A nested skill in a subdirectory.
★ 0