@shiftleftpt/sbd-toe-mcp 0.20.0-beta.4 → 0.20.0-beta.6

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.
Files changed (46) hide show
  1. package/assets/agent-guide.md +33 -0
  2. package/consumed-bundle.json +8 -8
  3. package/data/entities/proportionality.json +2 -2
  4. package/data/entities/sdlc_integration.json +2 -2
  5. package/data/publish/indexes/canonical_chunks.jsonl +4903 -4903
  6. package/data/publish/indexes/publication_manifest.json +4 -4
  7. package/data/publish/ontology/sbdtoe-ontology.yaml +1699 -21
  8. package/data/publish/overlay/framework_overlay_index.json +121 -11
  9. package/data/publish/overlay/overlay_mappings.jsonl +935 -646
  10. package/data/publish/runtime/artifact_requirements.json +218 -311
  11. package/data/publish/runtime/artifacts.json +82 -55
  12. package/data/publish/runtime/controls.json +870 -311
  13. package/data/publish/runtime/deterministic_manifest.json +2 -2
  14. package/data/publish/runtime/evidence_patterns.json +162 -162
  15. package/data/publish/runtime/requirement_control_links.json +2271 -1708
  16. package/data/publish/runtime/v1/manual_threat_mitigation.jsonl +233 -233
  17. package/data/publish/runtime/v1/v1_manifest.json +6 -4
  18. package/data/reports/run_manifest.json +4 -4
  19. package/dist/index.js +66 -3
  20. package/dist/index.js.map +1 -1
  21. package/dist/serving/affordances.d.ts +1 -0
  22. package/dist/serving/affordances.js +12 -3
  23. package/dist/serving/affordances.js.map +1 -1
  24. package/dist/serving/selection.d.ts +56 -0
  25. package/dist/serving/selection.js +289 -0
  26. package/dist/serving/selection.js.map +1 -0
  27. package/dist/tools/consult-security-requirements.d.ts +7 -0
  28. package/dist/tools/consult-security-requirements.js +38 -0
  29. package/dist/tools/consult-security-requirements.js.map +1 -1
  30. package/dist/tools/generate-sbd-toe-skill.js +7 -2
  31. package/dist/tools/generate-sbd-toe-skill.js.map +1 -1
  32. package/dist/tools/get-threat-landscape.js +36 -13
  33. package/dist/tools/get-threat-landscape.js.map +1 -1
  34. package/dist/tools/map-review-scope.d.ts +6 -0
  35. package/dist/tools/map-review-scope.js +19 -0
  36. package/dist/tools/map-review-scope.js.map +1 -1
  37. package/dist/tools/ontology-loader.d.ts +8 -0
  38. package/dist/tools/ontology-loader.js +9 -0
  39. package/dist/tools/ontology-loader.js.map +1 -1
  40. package/dist/tools/prepare-codegen-context.d.ts +55 -1
  41. package/dist/tools/prepare-codegen-context.js +151 -28
  42. package/dist/tools/prepare-codegen-context.js.map +1 -1
  43. package/dist/tools/select-requirements.d.ts +53 -0
  44. package/dist/tools/select-requirements.js +99 -0
  45. package/dist/tools/select-requirements.js.map +1 -0
  46. package/package.json +3 -2
@@ -55,7 +55,24 @@ get_sbd_toe_chapter_brief ← what a specific chapter covers (phases, art
55
55
  list_sbd_toe_chapters ← chapter discovery and navigation
56
56
  query_sbd_toe_entities ← specific controls (CTRL-*), artefacts (ART-*), practices
57
57
 
58
+ select_sbd_toe_requirements ← MP1 selection: which requirements apply to THIS task in THIS
59
+ context — baseline (ch. 02, by level) ∪ context-activated
60
+ chapters ⊕ overlay(extend), narrowed by declared task signals;
61
+ params: risk_level (required), task?, changed_files?,
62
+ technologies?, exposure?, data_sensitivity?, concerns?
63
+ returns TWO bands, both always listed:
64
+ selected[] — the recommendation for the task (each item
65
+ carries its selection_trace: source/trigger/
66
+ score, incl. named rules like
67
+ R1:principal-nao-humano)
68
+ narrowed_out[] — what was ELIGIBLE and why it left (grouped
69
+ by category, with reason). Nothing is dropped
70
+ silently: if you need something from there,
71
+ call again WITH the missing signal (e.g. the
72
+ SES group returns when the task mentions the
73
+ user session/login/token surface)
58
74
  consult_security_requirements ← deterministic: requirements + controls for a risk level
75
+ (mode: "index" opt-in returns a per-category id index)
59
76
  params: risk_level (L1|L2|L3), concerns? (string[])
60
77
  returns: requirements[], controls[], active_domains[],
61
78
  active_categories[], rule_trace[]
@@ -66,6 +83,17 @@ resolve_entities ← low-level ontology filter engine
66
83
  listing requirements by category, exploring the ontology
67
84
  ```
68
85
 
86
+ **Choosing between the three requirement surfaces:**
87
+ - `select_sbd_toe_requirements` — *"which requirements apply to THIS task / this change?"*
88
+ Task-scoped recommendation with declared narrowing (two bands, above). Start here for
89
+ any concrete piece of work.
90
+ - `consult_security_requirements` — *"what does the catalogue hold at this level?"*
91
+ Level-wide, deterministic. `mode: "index"` (opt-in) returns a compact per-category id
92
+ index first — expand later with the default mode + `concerns`.
93
+ - `prepare_sbd_toe_codegen_context` — the codegen/review instrument: grounded context +
94
+ `citation_map` for one concrete task (it consumes the same selection engine; its
95
+ `completeness_report.selection` declares eligible/selected/narrowed-out counts).
96
+
69
97
  **Prefer `consult_security_requirements` over `search_sbd_toe_manual`** when the question
70
98
  is structured ("what requirements apply at L2?", "which controls are active for auth?").
71
99
  Use `search_sbd_toe_manual` for narrative/conceptual questions.
@@ -137,6 +165,9 @@ Canonical role IDs (pass exact or common alias — resolved automatically):
137
165
  | `coverage_gaps.requirements_without_control_link` (consult) | Those requirements are active but have **no published control link** — say so (declared gap, routed to Codex); do not invent controls |
138
166
  | `match: "declared_gap"` / `meta.declared_gap` (query_sbd_toe_entities, resolve_entities) | Cite `declared_gap.note` verbatim — a legacy / unresolvable citation, not a missing requirement |
139
167
  | `citation_note` / `meta.citation_note` (informative) | The id is an illustrative example (`REQ-NNN`) or a non-requirement token (`CWE-`, `SHA-`) cited by the Manual — say so; it is not a requirement and not a gap |
168
+ | `selection.selected[]` (select) | The recommendation for the task — cite each item's `selection_trace` when asked *why* |
169
+ | `selection.narrowed_out[]` (select) | Eligible-but-narrowed, grouped with reason — never treat as "not applicable"; re-call with the missing signal to recover a group |
170
+ | `completeness_report.selection` (prepare) | The same two-band summary behind the codegen context — `narrowed_out_ref` names the tool to inspect it |
140
171
 
141
172
  #### Pattern for complex answers (threat model / security plan / checklist)
142
173
 
@@ -240,6 +271,8 @@ Always distinguish between:
240
271
  | "List all chapters" | `list_sbd_toe_chapters` |
241
272
  | "Find control / artefact / practice" | `query_sbd_toe_entities` |
242
273
  | "What requirements apply at L1/L2/L3?" | `consult_security_requirements(risk_level)` |
274
+ | "Which requirements apply to THIS task / this change?" | `select_sbd_toe_requirements(risk_level, task, changed_files?)` — `selected[]` is the recommendation; `narrowed_out[]` explains what left and why (re-call with the missing signal to recover it) |
275
+ | "Give me a compact id map of the catalogue by category" | `consult_security_requirements(risk_level, mode="index")` |
243
276
  | "Which controls are active for auth / logging / …?" | `consult_security_requirements(risk_level, concerns=[…])` |
244
277
  | "What threats apply to this project?" | `get_threat_landscape(risk_level)` |
245
278
  | "What threats are relevant for auth / logging / …?" | `get_threat_landscape(risk_level, concerns=[…])` |
@@ -2,17 +2,17 @@
2
2
  "_doc": "Pontifex bundle pin (PROGRAMME-PRESERVATION-PROTOCOL §0.6 / AGENTS.md Rule 4). Declares the Codex build artefact this MCP serves. Materialized + maintained by scripts/sync-bundle.mjs (digest-verified against the artefact .sha256), validated by scripts/verify-consumed-bundle.mjs (run in `npm run check`). source: dev-build = cycle snapshot; release = formal vX.Y.Z. release_sha256 is the verified artefact digest — never invented.",
3
3
  "pin_version": 1,
4
4
  "pinned_at": "2026-08-30",
5
- "consumer_contract_version": "v1.12",
5
+ "consumer_contract_version": "v1.14",
6
6
  "substrate_version": "v2-draft",
7
7
  "kg_bundle": {
8
- "release_tag": "v1.6.1",
9
- "release_sha256": "df6920cbef5bbd6f2b723708efe0b48ca5017abf8928bc800db0609536ef547b",
8
+ "release_tag": "v1.7.0",
9
+ "release_sha256": "29156b86ef7785966f099f02bb67dd84fcb471d64092944038a3da906c72fb9a",
10
10
  "source": "release",
11
- "release_ref": "SbD-ToE/sbd-toe-knowledge-graph@v1.6.1",
12
- "surface_built_at": "2026-08-29T23:21:40.627986+00:00",
11
+ "release_ref": "SbD-ToE/sbd-toe-knowledge-graph@v1.7.0",
12
+ "surface_built_at": "2026-08-30T22:18:08.383958+00:00",
13
13
  "tag_scheme": "semver",
14
- "synced_at": "2026-08-30",
15
- "artefact": "sbd-toe-knowledge-graph-bundle-v1.6.1.zip"
14
+ "synced_at": "2026-08-31",
15
+ "artefact": "sbd-toe-knowledge-graph-bundle-v1.7.0.zip"
16
16
  },
17
17
  "inputs": {
18
18
  "manual": {
@@ -20,7 +20,7 @@
20
20
  "commit": "8e03454c5137ded5a0a88ac2b91b1c4d6ee8fdac",
21
21
  "tag": "v1.7.1",
22
22
  "version": "1.7.1",
23
- "generated_at": "2026-08-29T23:21:12Z"
23
+ "generated_at": "2026-08-30T22:17:31Z"
24
24
  },
25
25
  "ontology": {
26
26
  "repo": "SbD-ToE/sbd-toe-ontology",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "agent": "lifecycle_extractor",
3
- "generated_at": "2026-08-29T23:21:12Z",
3
+ "generated_at": "2026-08-30T22:17:31Z",
4
4
  "items": [
5
5
  {
6
6
  "L1": "Obrigatório - Classificação simplificada, apenas eixos principais",
@@ -3083,7 +3083,7 @@
3083
3083
  "warnings": []
3084
3084
  }
3085
3085
  ],
3086
- "run_id": "20260829T232112Z",
3086
+ "run_id": "20260830T221731Z",
3087
3087
  "source": {
3088
3088
  "branch": "HEAD",
3089
3089
  "commit_sha": "8e03454c5137ded5a0a88ac2b91b1c4d6ee8fdac",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "agent": "lifecycle_extractor",
3
- "generated_at": "2026-08-29T23:21:12Z",
3
+ "generated_at": "2026-08-30T22:17:31Z",
4
4
  "items": [
5
5
  {
6
6
  "confidence": 0.91,
@@ -5217,7 +5217,7 @@
5217
5217
  "warnings": []
5218
5218
  }
5219
5219
  ],
5220
- "run_id": "20260829T232112Z",
5220
+ "run_id": "20260830T221731Z",
5221
5221
  "source": {
5222
5222
  "branch": "HEAD",
5223
5223
  "commit_sha": "8e03454c5137ded5a0a88ac2b91b1c4d6ee8fdac",