@antoneeo/kb-agentic-skill 1.19.0 → 1.21.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.
@@ -1,62 +1,62 @@
1
- #!/usr/bin/env python3
2
- """Knowledge lens entry point. Ship with sdlc_core.py and knowledge.py."""
3
- import sys
4
- from pathlib import Path
5
- sys.path.insert(0, str(Path(__file__).resolve().parent))
6
- try:
7
- import sdlc_core
8
- except ImportError as exc:
9
- sys.stderr.write("[ERROR] missing sdlc_core.py: %s\n"
10
- "Copy entry point, sdlc_core.py and knowledge.py together.\n" % exc)
11
- sys.exit(1)
12
- from sdlc_core import *
13
- from sdlc_core import _map_refs
14
- import knowledge
15
- from knowledge import *
16
- from knowledge import _kb_extra_validate, _kb_original_candidates
17
-
18
- DOMAIN = "knowledge"
19
-
20
- sdlc_core.set_entry_point(DOMAIN, provides=("code", "knowledge"))
21
-
22
- sdlc_core.set_profile(
23
- skill_name="kb-agentic",
24
- unit_noun="topic",
25
- support_files=("templates.md", "taxonomy.md", "guides.md", "vision.md",
26
- "distillation.md", "reconciliation.md", "elicitation.md",
27
- "review.md", "dispatch.md", "routing.md", "portability.md",
28
- "ENFORCEMENT.md", "memory.md"),
29
- capabilities=(
30
- # spine
31
- "triage", "write_triggers", "workstream_registry", "vision_gate",
32
- "design_review_gate", "guide_router", "worktree_hygiene",
33
- # knowledge overlay
34
- # `knowledge_portability` (F-030) is deliberately NOT declared: the
35
- # capability vocabulary lives in the shared spine, and no shared test
36
- # guards on portability, so adding a label there would mean editing
37
- # sdlc_core.py in three distributions to buy nothing.
38
- "taxonomy_pass", "subagent_dispatch", "question_discipline",
39
- ),
40
- # F-046: the per-turn line moved from this file's own `remind` command into
41
- # the shared spine, which now carries the machine for all three lenses. The
42
- # kb duties below are unchanged; what is new is the first one -- an unread
43
- # protocol cannot be applied, and until now nothing said so.
44
- remind_line=(
45
- "first decide if this skill governs the work; if yes, LOAD it once -- an "
46
- "unread protocol cannot be applied. Triage: L1 quick fact, L2 propagation, "
47
- "L3 new knowledge unit, Spike; declare the level. On this project's "
48
- "domain, read topics/INDEX.md first and cite claim ids, or state no "
49
- "coverage. Decisions today get recorded in the KB at close. Revising a "
50
- "document? Re-read it whole and rewrite to current state -- never append "
51
- "a delta."
52
- ),
53
- design_gate_between=("### 3. Request Analysis & Taxonomy Pass",
54
- "### 4. Knowledge Processing & Distillation"),
55
- )
56
-
57
-
58
- def main(argv=None):
59
- return knowledge.main(argv)
60
-
61
- if __name__ == "__main__":
62
- sys.exit(main())
1
+ #!/usr/bin/env python3
2
+ """Knowledge lens entry point. Ship with sdlc_core.py and knowledge.py."""
3
+ import sys
4
+ from pathlib import Path
5
+ sys.path.insert(0, str(Path(__file__).resolve().parent))
6
+ try:
7
+ import sdlc_core
8
+ except ImportError as exc:
9
+ sys.stderr.write("[ERROR] missing sdlc_core.py: %s\n"
10
+ "Copy entry point, sdlc_core.py and knowledge.py together.\n" % exc)
11
+ sys.exit(1)
12
+ from sdlc_core import *
13
+ from sdlc_core import _map_refs
14
+ import knowledge
15
+ from knowledge import *
16
+ from knowledge import _kb_extra_validate, _kb_original_candidates
17
+
18
+ DOMAIN = "knowledge"
19
+
20
+ sdlc_core.set_entry_point(DOMAIN, provides=("code", "knowledge"))
21
+
22
+ sdlc_core.set_profile(
23
+ skill_name="kb-agentic",
24
+ unit_noun="topic",
25
+ support_files=("templates.md", "taxonomy.md", "guides.md", "vision.md",
26
+ "distillation.md", "reconciliation.md", "elicitation.md",
27
+ "review.md", "dispatch.md", "routing.md", "portability.md",
28
+ "ENFORCEMENT.md", "memory.md"),
29
+ capabilities=(
30
+ # spine
31
+ "triage", "write_triggers", "workstream_registry", "vision_gate",
32
+ "design_review_gate", "guide_router", "worktree_hygiene",
33
+ # knowledge overlay
34
+ # `knowledge_portability` (F-030) is deliberately NOT declared: the
35
+ # capability vocabulary lives in the shared spine, and no shared test
36
+ # guards on portability, so adding a label there would mean editing
37
+ # sdlc_core.py in three distributions to buy nothing.
38
+ "taxonomy_pass", "subagent_dispatch", "question_discipline",
39
+ ),
40
+ # F-046: the per-turn line moved from this file's own `remind` command into
41
+ # the shared spine, which now carries the machine for all three lenses. The
42
+ # kb duties below are unchanged; what is new is the first one -- an unread
43
+ # protocol cannot be applied, and until now nothing said so.
44
+ remind_line=(
45
+ "first decide if this skill governs the work; if yes, LOAD it once -- an "
46
+ "unread protocol cannot be applied. Triage: L1 quick fact, L2 propagation, "
47
+ "L3 new knowledge unit, Spike; declare the level. On this project's "
48
+ "domain, read topics/INDEX.md first and cite claim ids, or state no "
49
+ "coverage. Decisions today get recorded in the KB at close. Revising a "
50
+ "document? Re-read it whole and rewrite to current state -- never append "
51
+ "a delta."
52
+ ),
53
+ design_gate_between=("### 3. Request Analysis & Taxonomy Pass",
54
+ "### 4. Knowledge Processing & Distillation"),
55
+ )
56
+
57
+
58
+ def main(argv=None):
59
+ return knowledge.main(argv)
60
+
61
+ if __name__ == "__main__":
62
+ sys.exit(main())
@@ -203,6 +203,11 @@ DOMAINS = {
203
203
  "risk_label": "## Threat Map / Plan Risks",
204
204
  "id_prefix": "M-",
205
205
  },
206
+ "course": {
207
+ "risk_section": ("## Learning and Content Risks",),
208
+ "risk_label": "## Learning and Content Risks",
209
+ "id_prefix": "C-",
210
+ },
206
211
  }
207
212
  # Absent everything -- no `default_domain:` line, no `domain:` field -- a project is
208
213
  # `code`. That is what every project created before this field existed already is,
@@ -1298,7 +1303,7 @@ def cmd_validate(root, strict=False, hybrid=False):
1298
1303
  "have the user validate it")
1299
1304
 
1300
1305
  # ANALYSIS: frontmatter and mandatory sections
1301
- # Ids are unique WITHIN a domain (prefixes F-/K-/M- keep them apart in practice):
1306
+ # Ids are unique WITHIN a domain (prefixes F-/K-/M-/C- keep them apart in practice):
1302
1307
  # two lenses over one tree must not collide on a number neither of them chose.
1303
1308
  seen_ids = {}
1304
1309
  default_domain = project_default_domain(root)
@@ -1349,10 +1354,10 @@ def cmd_validate(root, strict=False, hybrid=False):
1349
1354
  "doing the work it triggers")
1350
1355
  # comment-stripped, anchored: a '<!-- TODO: the ## Capability Ledger -->'
1351
1356
  # must not read as the section being present
1352
- # Hybrid: the design lives in devPNT and its §4.5 gate owns this slot
1353
- # (the Hybrid ownership matrix: "run ONE of them, never both"), and its log
1354
- # rows are keyed on e_isp_/e_tdd_ doc_keys, not on this filename -- so
1355
- # firing here would be a permanent, unfixable false positive.
1357
+ # Hybrid: the design lives in devPNT, and the agent review of it (the
1358
+ # same review.md review, run before the proposal) logs a row keyed on
1359
+ # its e_isp_/e_tdd_ doc_key, not on this filename -- so firing here
1360
+ # would be a permanent, unfixable false positive.
1356
1361
  if not hybrid and design_review_due(meta) and not review_logged(root, p.name):
1357
1362
  advisories.append(f"{rel}: L3 in implementation with no design-review row in "
1358
1363
  f"{review_log_rel()} -- the design was reviewed by nobody but its "
@@ -1864,15 +1869,26 @@ def print_orient_hook_note(root):
1864
1869
  pass # detection must never break check
1865
1870
 
1866
1871
 
1867
- def cmd_check(root, strict=False, hybrid=False):
1872
+ def cmd_check(root, strict=False, hybrid=False, extra_validate=None, extra_sections=()):
1873
+ """An overlay adds its checks through the two hooks, never after the call:
1874
+ the summary line is the verdict, so every check that can fail runs before
1875
+ it. `extra_validate()` folds into the validate stage; each
1876
+ (title, fn) in `extra_sections` gets its own banner and summary rc."""
1868
1877
  print("===== validate =====")
1869
1878
  rc_v = cmd_validate(root, strict=strict, hybrid=hybrid)
1879
+ if extra_validate is not None:
1880
+ rc_v = max(rc_v, extra_validate())
1870
1881
  print("\n===== stale =====")
1871
1882
  rc_s = cmd_stale(root, hybrid=hybrid)
1872
- print(f"\ncheck: {'CLEAN' if not (rc_v or rc_s) else 'NOT CLEAN'} "
1873
- f"(validate rc={rc_v}, stale rc={rc_s})")
1883
+ rcs = [("validate", rc_v), ("stale", rc_s)]
1884
+ for title, fn in extra_sections:
1885
+ print(f"\n===== {title} =====")
1886
+ rcs.append((title, fn()))
1887
+ failed = any(rc for _, rc in rcs)
1888
+ print(f"\ncheck: {'NOT CLEAN' if failed else 'CLEAN'} "
1889
+ f"({', '.join(f'{title} rc={rc}' for title, rc in rcs)})")
1874
1890
  print_orient_hook_note(root)
1875
- return 1 if (rc_v or rc_s) else 0
1891
+ return 1 if failed else 0
1876
1892
 
1877
1893
 
1878
1894
  # --------------------------------------------------------------------- gate
@@ -20,6 +20,8 @@ supersedes: old_doc.md # only if it replaces another canonical doc
20
20
 
21
21
  When a doc replaces another: the new one declares `supersedes:`, the old one switches to `status: SUPERSEDED` (it stays as history, do not delete it). `sdlc_check.py validate` warns if `status` is missing or if a superseded doc is still `CURRENT`.
22
22
 
23
+ For a course in the same `ai_docs/` tree, `vision/features/VISION_course_<slug>.md` and `solutions/ANALYSIS_course_<slug>.md` declare `domain: course` explicitly and the ANALYSIS uses a `C-` ID. The feature Vision is scoped to that course; the project-wide Vision stays above all four domains. Course design belongs to `course-creator`.
24
+
23
25
  ## ai_docs/reference/GUIDE_[topic].md
24
26
 
25
27
  A guide is either OPERATIVE (`source_kind: document` — distilled from USER-PROVIDED
@@ -441,7 +443,7 @@ One row per completed review (`review.md` §When a review is due). Append-only;
441
443
  is the record that the gate ran and what it was worth. **One schema for both
442
444
  modes** — one required CORE (`date`, `doc_key`, `tier`, `model`, `findings_raised`,
443
445
  `findings_real`, `verdict`, `revise_rounds`) plus each mode's own realization
444
- columns: Standalone adds `reviewer`, a Hybrid devPNT row adds `instrument` and
446
+ columns: Standalone adds `reviewer`, a Hybrid row adds `instrument` and
445
447
  `notes` and carries no `reviewer` at all. Both modes write this same file.
446
448
 
447
449
  ```markdown