Skip to content

I0814 — Give the worker a bounded slice of knowledge, not the knowledge base

Add a knowledge section to `majordomus context`, selected deterministically from what the active task and issue already reference, capped by a profile toggle and an item limit, dropped before any immutable fact when the budget is short, and named under EXCLUDED whenever it is dropped or switched off.

BLOCKED wave 6 · p1 · implementation profile · runs alone

Part of M003 — A session is a durable envelope, and knowledge is compiled from what is already canonical.

Blocked. This issue cannot start until I0811 is done. The status is derived from that, not declared.

Objective

Add a knowledge section to `majordomus context`, selected deterministically from what the active task and issue already reference, capped by a profile toggle and an item limit, dropped before any immutable fact when the budget is short, and named under EXCLUDED whenever it is dropped or switched off.

Why

A context builder that dumps an index has replaced a selection problem with a bigger one. The value is in choosing the few pointers a worker needs, from relationships that are already explicit, and in saying out loud what was left out.

Current state

context assembles nine sections in authority order with a fixed drop order and names every exclusion. Its profile toggles decide what is asked for.

Desired state

The profile carries a knowledge toggle and a maximum item count, both in the profile allowlist. The section lists pointers — id, kind, title and source path — for the current issue, its dependencies, the claims it names and the documents it references. It sits below every immutable fact in the drop order and above nothing that outranks it.

Scope

  • lib/context.sh
  • share/skeleton
  • share/allow/profile.txt
  • .majordomus/profiles
  • docs
  • test/cases/72_context_knowledge.sh

Out of scope

  • Any similarity-based selection
  • Rebuilding the index from context
  • Raising the existing line budget

Dependencies

What waits on this

Acceptance criteria

  • The section appears only when the profile asks for it, and its absence is named under EXCLUDED with the toggle that caused it
  • It is dropped before git, the task, the profile and open blockers under a tight budget, and the drop is named
  • Selection comes from explicit references only, and a case proves an unrelated document is not selected
  • A stale index makes the section report staleness rather than silently omit itself
  • The existing context case still passes unchanged

Validation

  • bash test/run.sh 72_context_knowledge
  • bash test/run.sh 23_context

Evidence required

  • context_bounded

Evidence

None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.

Risk

The budget is already close to full on a rich task. If the knowledge section is added without measuring, it will be the section that always gets dropped, which is a feature nobody receives.

Timeline

started
verified
completed

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I0814.yaml. Read it back with majordomus plan show I0814.