Skip to content

feat: surface team-knowledge corpus at session start#62

Merged
arzafran merged 1 commit into
mainfrom
feat/team-knowledge-session-awareness
Jun 19, 2026
Merged

feat: surface team-knowledge corpus at session start#62
arzafran merged 1 commit into
mainfrom
feat/team-knowledge-session-awareness

Conversation

@arzafran

Copy link
Copy Markdown
Member

What this does

The shared team-knowledge corpus was effectively write-only — /share-learning posts notes, but nothing pulled them back out when an agent was about to make a decision they'd inform, so they rarely got consulted. This adds the missing read side: at session start, if you've pointed KNOWLEDGE_REPO_PATH at a local clone (the same env var lint:knowledge/new-note already use) and it has notes, you get a one-line ping reminding the agent the corpus exists and is worth an rg.

Fully opt-in and quiet: no env var set → nothing happens. It does no network calls and never blocks startup (the SessionStart hook is a hot path), so it can't slow your session down.

Summary

  • New src/lib/team-knowledge.tsteamKnowledgeAwareness(repoPath?): lists .md notes in the clone (excludes README/INDEX/CONTRIBUTING), returns a short awareness block when non-empty, [] otherwise. Zero network, fail-open, never throws.
  • session-start.ts calls it in the display phase, right after the auto-memory pointer.
  • This is deliberately the awareness half; actual retrieval stays on-demand/live (a follow-up /knowledge-style consult path can use gh api so no clone is needed to read).

Test Plan

  • bun run typecheck — clean
  • bun test tests/team-knowledge.test.ts — 5/5 (unset path, missing dir, empty corpus, 1 note singular, 3 notes plural)
  • bun test — 581 pass / 0 fail
  • bun run lint — clean

Note: independent of #61 (touches different files); the two can merge in any order.

…open

The team-knowledge corpus was effectively write-only: /share-learning posts
notes but nothing surfaced them when an agent would use them, so they rarely got
read. SessionStart now prints a one-line awareness ping when $KNOWLEDGE_REPO_PATH
points at a non-empty local clone (the same env var lint:knowledge/new-note use).

Hot-path safe: zero network I/O (no gh api), fail-open (any error → no output,
never blocks startup), and silent unless a clone is configured and non-empty.
Live retrieval stays on-demand elsewhere; this only makes the agent aware the
corpus exists and worth an rg.
@arzafran arzafran merged commit acebf1d into main Jun 19, 2026
15 checks passed
@arzafran arzafran deleted the feat/team-knowledge-session-awareness branch June 19, 2026 20:37
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.

1 participant