@knowledge-bus/opencode 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/index.js +12 -0
- package/package.json +30 -0
- package/references/agent-runtime.md +35 -0
- package/references/knowledge-bus-directory.md +53 -0
- package/references/knowledge-bus-protocol.yaml +432 -0
- package/references/product-development/type-guidance.kbp.yaml +711 -0
- package/references/product-development/universe.kbp.yaml +411 -0
- package/runtime/kbp.py +91 -0
- package/runtime/knowledge_bus-0.5.0-py3-none-any.whl +0 -0
- package/runtime/requirements.json +9 -0
- package/skills/kb-check/SKILL.md +30 -0
- package/skills/kb-evolve/SKILL.md +84 -0
- package/skills/kb-ingest/SKILL.md +59 -0
- package/skills/kb-uncover-decision/SKILL.md +32 -0
- package/skills/kb-uncover-question/SKILL.md +35 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kb-ingest
|
|
3
|
+
description: Map existing notes or documents into Knowledge Bus definitions and sourced answers, surfacing conflicts and gaps without changing source files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ingest a Knowledge Base
|
|
7
|
+
|
|
8
|
+
**Purpose — turn a folder the user no longer trusts into a spec they can trust, with every mapping decision visible and every refusal recorded.**
|
|
9
|
+
|
|
10
|
+
## Standing constraints
|
|
11
|
+
|
|
12
|
+
- **Source files are read-only.** Write only within `<target>/.knowledge-bus/`; never modify existing source files.
|
|
13
|
+
- **Separate target folders.** Exclude every `.knowledge-bus/` directory from source discovery. Skip and report nested folders with their own `.knowledge-bus/`; ingest those separately only when explicitly targeted.
|
|
14
|
+
- **Review existing outputs.** Before writing, inspect existing definitions, guidance, answers, and logs. Reuse the established definitions or propose deliberate changes. Preserve prior decisions and history; do not reset or blindly overwrite files. Stop on incompatible or ambiguous existing content and ask how to proceed.
|
|
15
|
+
- **Directory contract.** Follow [Knowledge Bus Directory](../../references/knowledge-bus-directory.md). No sibling-output discovery or migration is performed.
|
|
16
|
+
- **Questions are earned.** Reason through everything gathered so far before asking; a question the corpus can answer is never put to the user. The interview carries judgment to the user, not work.
|
|
17
|
+
- **Interview in the user's language.** Format vocabulary — spec, collision, staleness marks, placement — never appears in a question. The user is asked about their project in its own terms; the mechanism stays in the reasoning and the log.
|
|
18
|
+
- **A forced mapping is worse than a refusal.**
|
|
19
|
+
- **Report before writing.** The user sees the survey and the spec choice before any answer is filed.
|
|
20
|
+
|
|
21
|
+
## The flow
|
|
22
|
+
|
|
23
|
+
- **1. Confirm the target folder.** Only the source folder is asked for. Output goes to `<target>/.knowledge-bus/` by
|
|
24
|
+
convention. Inspect that directory if it already exists; the domain phrase is proposed after the survey and confirmed, never requested cold.
|
|
25
|
+
|
|
26
|
+
- **2. Survey before reading.** Inventory files, dates, and formats; report counts to the user before any deep read.
|
|
27
|
+
Three staleness marks: **contradicted** (a newer source disputes it — mechanical), **unconfirmed**
|
|
28
|
+
(older than the corpus's age threshold, nothing disputes it), **confirmed** (cleared during the interview).
|
|
29
|
+
Confirmation questions come batched and informed — reason through the whole survey first so the user rules
|
|
30
|
+
on genuine uncertainty, not on what the corpus already settles.
|
|
31
|
+
|
|
32
|
+
- **3. Position the domain, then choose the spec.** Locate the starter using [Checker for Agent Workflows](../../references/agent-runtime.md). Reason over the folder
|
|
33
|
+
and whatever the user supplied, clarifying unclear questions by probing what answering each would enable and checking for overlap,
|
|
34
|
+
then interview to place the domain against the product-agnostic built-in: how regulated or commercial
|
|
35
|
+
versus DIY, and where the abstraction layer sits — industry, company, product, or feature. Adopt, trim,
|
|
36
|
+
or derive follows from that placement; structural changes require the user's review. If `kb-evolve` is installed, offer it; otherwise explain the proposed change and stop before changing the structure.
|
|
37
|
+
|
|
38
|
+
- **4. Extract answers.** Map each document section to a declared question; one answer per question per party and time.
|
|
39
|
+
A collision — two docs answering the same question — is never resolved by recency. The older doc may be the
|
|
40
|
+
forgotten original and the newer a lacking recollection; authority and authorship matter. Surface the collision
|
|
41
|
+
with its provenance (age gap, authors, what each claims) and put an informed question to the user in the interview.
|
|
42
|
+
Rulings live in the ingest log, not on answers: each entry records the collision, the ruling, who ruled, and the
|
|
43
|
+
reasoning. Answers stay clean; a collision the user declines to rule is filed **contested**.
|
|
44
|
+
|
|
45
|
+
- **5. Refuse honestly.** Content answering no declared question is flagged, never forced into a near-fit; core questions with no answer are listed as gaps.
|
|
46
|
+
Refusals repeating on one theme signal a missing question — offer structural review (`kb-evolve` if installed) — rather than off-domain content.
|
|
47
|
+
|
|
48
|
+
- **6. Write the outputs.** The universe (`universe.kbp.yaml`), optional guidance (`type-guidance.kbp.yaml`), answers, and the ingest log all go in `<target>/.knowledge-bus/`.
|
|
49
|
+
Existing source files remain untouched. Answers go in `answers.yaml`, one record
|
|
50
|
+
per answer: `element`, `party`, `date`, `status`, `answer`, `source`, and `supersedes` where a ruling
|
|
51
|
+
displaced something; gaps list `element` and `reason`. The shape is fixed; the checker does not yet
|
|
52
|
+
validate it.
|
|
53
|
+
|
|
54
|
+
- **7. Validate.** Follow [Checker for Agent Workflows](../../references/agent-runtime.md) and run the bundled checker with `--validate <target>/.knowledge-bus/`. Fix or surface every refusal before reporting. Only definition and guidance files are checked; answers and the log require review.
|
|
55
|
+
|
|
56
|
+
- **8. Report coverage.** One table, **contested** first — unresolved collisions block trust — then mapped,
|
|
57
|
+
stale (contradicted or merely unconfirmed), refused, gaps. Each class names its ask: rule it; spot-check;
|
|
58
|
+
confirm or retire; accept as off-domain or review a proposed new question; answer, or record what an
|
|
59
|
+
honest empty means.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kb-uncover-decision
|
|
3
|
+
description: Recover a decision's alternatives, constraints, authority, and reversal conditions when its record lacks context.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Uncover a Decision
|
|
7
|
+
|
|
8
|
+
**Purpose — recover the constraints that were live when the decision was made, not just its output. A record that carries only the conclusion reads as true and is unusable.**
|
|
9
|
+
|
|
10
|
+
## Knowledge Bus Directory
|
|
11
|
+
|
|
12
|
+
Follow [Knowledge Bus Directory](../../references/knowledge-bus-directory.md). Use an explicit target when supplied; otherwise resolve the nearest `.knowledge-bus/` from the user's working directory. Inspect existing files before proposing changes and preserve existing definitions and decision history. Do not combine definitions from different Knowledge Bus directories. Write only inside the selected `.knowledge-bus/`; leave source files untouched. If definitions are absent, ask the user to select or explicitly create a set rather than inventing one silently.
|
|
13
|
+
|
|
14
|
+
## Standing constraints
|
|
15
|
+
|
|
16
|
+
- **Past tense throughout.** What was live, not what is sensible now.
|
|
17
|
+
- **Reconstruction is flagged as reconstruction.** Memory is not evidence.
|
|
18
|
+
- **A decision with no reversal condition is not fully recovered.**
|
|
19
|
+
|
|
20
|
+
## The flow
|
|
21
|
+
|
|
22
|
+
- **1. State the decision as recorded.** Name what is missing from it.
|
|
23
|
+
|
|
24
|
+
- **2. Recover the provenance.** Who was in the room, whose call it was, and on what authority. This feeds later collision rulings — an ingest weighing two conflicting docs needs to know which carried the authority.
|
|
25
|
+
|
|
26
|
+
- **3. Recover the live alternatives.** What was actually on the table, not what could have been.
|
|
27
|
+
|
|
28
|
+
- **4. Recover the binding constraints.** What ruled options out, in force at the time.
|
|
29
|
+
|
|
30
|
+
- **5. Name the reversal condition.** What changing would reopen this.
|
|
31
|
+
|
|
32
|
+
- **6. File as answers** against declared questions; flag what stayed ambiguous.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kb-uncover-question
|
|
3
|
+
description: Clarify a question a Knowledge Bus universe should declare, testing its purpose and overlap with existing questions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Uncover a Question
|
|
7
|
+
|
|
8
|
+
**Purpose — arrive at a question worth declaring: one job, no overlap with any declared question, stated tersely enough to key answers on.**
|
|
9
|
+
|
|
10
|
+
## Knowledge Bus Directory
|
|
11
|
+
|
|
12
|
+
Follow [Knowledge Bus Directory](../../references/knowledge-bus-directory.md). Use an explicit target when supplied; otherwise resolve the nearest `.knowledge-bus/` from the user's working directory. Inspect existing files before proposing changes and preserve existing definitions and decision history. Do not combine definitions from different Knowledge Bus directories. Write only inside the selected `.knowledge-bus/`; leave source files untouched. If definitions are absent, ask the user to select or explicitly create a set rather than inventing one silently.
|
|
13
|
+
|
|
14
|
+
## Standing constraints
|
|
15
|
+
|
|
16
|
+
- **Questions are earned.** Reason through everything held before asking; a question the material can answer is never put to the interviewee.
|
|
17
|
+
- **Batches, not a stream.** Ask in small batches; reflect on the answers before the next. One or two follow-up batches usually land in the same sitting.
|
|
18
|
+
- **One question, one job.** A candidate with two conjunctions is two candidates.
|
|
19
|
+
- **A near-duplicate is refused, not merged silently.**
|
|
20
|
+
- **The interviewer supplies pressure, not answers.**
|
|
21
|
+
- **Interview in the interviewee's language.** Format vocabulary never appears in a question; the tests run in the reasoning, not in the asking.
|
|
22
|
+
|
|
23
|
+
## The loop
|
|
24
|
+
|
|
25
|
+
Every round runs the same shape. Loop until a round changes nothing.
|
|
26
|
+
|
|
27
|
+
- **1. Reason first.** Re-read everything held — the material, prior answers, every declared question. Draft what the next batch must uncover; discard whatever the record already settles.
|
|
28
|
+
|
|
29
|
+
- **2. Ask one batch.** A few pointed questions on the enablement — what does answering this let someone do? — never on wording. Wording anchors the interviewee; enablement doesn't.
|
|
30
|
+
|
|
31
|
+
- **3. Reflect and test.** Against the answers, run the tests: an enablement a declared question already covers is a collision — rule *sharpen existing / new / refused*; two jobs is a split; a candidate with no honest empty answer is not load-bearing.
|
|
32
|
+
|
|
33
|
+
- **4. Follow up or converge.** Where a test left ambiguity, ask a follow-up batch in the same sitting. A round that changes nothing ends the loop.
|
|
34
|
+
|
|
35
|
+
- **5. Declare.** Freeze the wording last. Mint a code using [Checker for Agent Workflows](../../references/agent-runtime.md); record every refusal with its reason.
|