Skip to content

Add founder-context + per-squad alignment as first-class context layers #769

@kokevidaurre

Description

@kokevidaurre

Why

Today's smoke test of squads run intelligence proved the current context system has a critical gap: agents have no awareness of the founder's live strategic state (active client work, in-flight PRs, recent decisions, dismissed topics, hands-off files). They run from squad-internal goals/priorities/feedback only, so they invent generic work disconnected from what the founder is actually pushing on.

Concrete failure: agents closed 3 active PRs, edited locked goals.md files, and merged a PR the founder was reviewing — all because they had no view into recent interactive sessions or current priorities.

Reframing: squads should work like a real management team. A COO doesn't tell departments "don't break things"; they brief them on the state of the business so each department contributes from its domain. Today's context is defensive. We need affirmative alignment.

What

Add two new layers to gatherSquadContext():

  • L9 .agents/memory/company/founder-context.md — universal live strategic state (auto-generated from CC sessions + git activity + open PRs/issues + directives). Visible to all roles.
  • L10 .agents/memory/{squad}/founder-alignment.md — per-squad translation: "given the universal context, here's how YOUR squad contributes this cycle" with named files/PRs/clients. Visible to all roles.

Both layers injected at the top of the action-first ordering so the LLM gives them maximum attention.

Also add a pre-step to squads run --org that runs the digest script (scripts/founder-context-digest.py in the project root) when context is stale (>2h) or missing. If the digest fails, the org cycle is blocked rather than running with stale or no alignment.

Acceptance

  • gatherSquadContext reads company/founder-context.md and {squad}/founder-alignment.md when present
  • Both files appear at the top of the assembled prompt
  • All 5 roles (scanner, worker, lead, coo, verifier) see both layers
  • Token budgets bumped to accommodate ~3K extra chars per layer
  • squads run --org runs scripts/founder-context-digest.py pre-flight when context is stale; aborts on digest failure
  • Missing files are skipped gracefully (no crash for fresh squads init users)
  • All existing tests pass
  • Smoke test: a single squad run loads both new layers and references hands-off content from founder-context

Out of scope

  • The digest script itself lives in hq/scripts/founder-context-digest.py (the script that produces the files). This issue is the CLI loader + pre-step only.
  • SessionEnd hook for auto-refresh between manual runs (future).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions