mirror of https://github.com/garrytan/gstack.git
scripts/resolvers/gbrain.ts adds:
- generateBrainPreflight(ctx) — emits per-skill ## Brain Context
block + bash that loads digests via
gstack-brain-cache get (one call per
digest). Per-skill subset comes from
SKILL_DIGEST_SUBSETS (single source).
- generateBrainCacheRefresh(ctx) — at-skill-end background refresh hook;
non-blocking; warms cache for next run.
- generateBrainWriteBack(ctx) — Phase 2 / E5 calibration write-back
with per-skill weight. Gated on
personal trust policy + the
BRAIN_CALIBRATION_WRITEBACK flag.
Includes invalidation bash that busts
affected digests after the write.
scripts/resolvers/index.ts registers three new placeholders:
{{BRAIN_PREFLIGHT}}, {{BRAIN_CACHE_REFRESH}}, {{BRAIN_WRITE_BACK}}
All three resolvers return empty string for skills not in
SKILL_DIGEST_SUBSETS (defensive — skill template authors can drop the
placeholders into non-preflight skills with zero effect).
D9 privacy is mentioned in the rendered preflight prose so the agent
knows to expect filtered salience.
D11 codex tension: write-back gates on brain_trust_policy@<hash> being
personal — shared brains skip write-back to avoid polluting team
calibration profile.
test/brain-preflight.test.ts: 19 tests covering subset rendering,
non-preflight skill gating, cross-project vs per-project --project flag
emission, weight injection per skill, BRAIN_CALIBRATION_WRITEBACK flag
mention, and registration in RESOLVERS map.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| app | ||
| host-adapters | ||
| resolvers | ||
| analytics.ts | ||
| archetypes.ts | ||
| brain-cache-spec.ts | ||
| build-app.sh | ||
| build.sh | ||
| capture-baseline.ts | ||
| compare-pr-version.ts | ||
| detect-bump.ts | ||
| dev-skill.ts | ||
| discover-skills.ts | ||
| eval-compare.ts | ||
| eval-list.ts | ||
| eval-select.ts | ||
| eval-summary.ts | ||
| eval-watch.ts | ||
| garry-output-comparison.ts | ||
| gen-llms-txt.ts | ||
| gen-skill-docs.ts | ||
| gstack-schema-pack.ts | ||
| host-config-export.ts | ||
| host-config.ts | ||
| jargon-list.json | ||
| models.ts | ||
| one-way-doors.ts | ||
| preflight-agent-sdk.ts | ||
| proactive-suggestions.json | ||
| psychographic-signals.ts | ||
| question-registry.ts | ||
| setup-scc.sh | ||
| skill-check.ts | ||
| slop-diff.ts | ||
| task-emission-schema.ts | ||
| test-free-shards.ts | ||
| update-readme-throughput.ts | ||
| write-version-files.sh | ||