mirror of https://github.com/garrytan/gstack.git
Adds the conditional-resolver-injection plumbing from the v2_PLAN A.1
step. Resolvers can now be either a bare ResolverFn (always fires, current
behavior) or a ResolverEntry { resolve, appliesTo? } (gated; appliesTo
returning false skips the resolver, substitutes empty string).
Why infrastructure-only: the audit during T0a confirmed most resolvers
don't need gating. The {{NAME}} placeholder system is already conditional
at the template level — a resolver only fires for skills that reference it.
The gate is for future use when a placeholder's audience needs a structural
guardrail beyond social convention, or when a sub-resolver inside a larger
composed resolver (e.g. preamble) needs per-skill skip.
scripts/gen-skill-docs.ts:444 now uses unwrapResolver() to handle both
shapes. RESOLVERS map signature widens from Record<string, ResolverFn>
to Record<string, ResolverValue>. All existing resolvers stay bare
functions and work unchanged.
Test plan:
- bun test test/resolver-entry.test.ts: 6 pass (gate plumbing + registry)
- bun test test/gen-skill-docs.test.ts: 389 pass (no regression)
- bun run gen:skill-docs --dry-run: all SKILL.md files FRESH (no diff)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| preamble | ||
| browse.ts | ||
| codex-helpers.ts | ||
| composition.ts | ||
| confidence.ts | ||
| constants.ts | ||
| design.ts | ||
| dx.ts | ||
| gbrain.ts | ||
| index.ts | ||
| learnings.ts | ||
| make-pdf.ts | ||
| model-overlay.ts | ||
| preamble.ts | ||
| question-tuning.ts | ||
| review-army.ts | ||
| review.ts | ||
| tasks-section.ts | ||
| testing.ts | ||
| types.ts | ||
| utility.ts | ||