@shiftleftpt/sbd-toe-mcp 0.20.0-beta.22 → 0.20.0-beta.24
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/assets/agent-guide.md +28 -60
- package/dist/index.js +17 -164
- package/dist/index.js.map +1 -1
- package/dist/serving/activation-vocabulary.d.ts +1 -0
- package/dist/serving/activation-vocabulary.js +2 -1
- package/dist/serving/activation-vocabulary.js.map +1 -1
- package/dist/serving/agent-guide.d.ts +18 -0
- package/dist/serving/agent-guide.js +180 -0
- package/dist/serving/agent-guide.js.map +1 -0
- package/dist/serving/protocol-envelope.d.ts +2 -0
- package/dist/serving/protocol-envelope.js.map +1 -1
- package/dist/serving/selection.d.ts +33 -2
- package/dist/serving/selection.js +162 -7
- package/dist/serving/selection.js.map +1 -1
- package/dist/serving/server-surface.d.ts +68 -0
- package/dist/serving/server-surface.js +169 -0
- package/dist/serving/server-surface.js.map +1 -0
- package/dist/tools/assess-implementation.js +2 -1
- package/dist/tools/assess-implementation.js.map +1 -1
- package/dist/tools/consult-security-requirements.d.ts +2 -0
- package/dist/tools/consult-security-requirements.js +3 -1
- package/dist/tools/consult-security-requirements.js.map +1 -1
- package/dist/tools/generate-sbd-toe-skill.d.ts +1 -0
- package/dist/tools/generate-sbd-toe-skill.js +6 -5
- package/dist/tools/generate-sbd-toe-skill.js.map +1 -1
- package/dist/tools/get-chapter-implementation-checklist.js +2 -1
- package/dist/tools/get-chapter-implementation-checklist.js.map +1 -1
- package/dist/tools/get-guide-by-role.d.ts +2 -0
- package/dist/tools/get-guide-by-role.js +2 -1
- package/dist/tools/get-guide-by-role.js.map +1 -1
- package/dist/tools/get-operating-model.js +2 -1
- package/dist/tools/get-operating-model.js.map +1 -1
- package/dist/tools/get-threat-landscape.d.ts +17 -0
- package/dist/tools/get-threat-landscape.js +52 -1
- package/dist/tools/get-threat-landscape.js.map +1 -1
- package/dist/tools/get-verification-matrix.js +2 -1
- package/dist/tools/get-verification-matrix.js.map +1 -1
- package/dist/tools/map-regulatory-activation.js +2 -1
- package/dist/tools/map-regulatory-activation.js.map +1 -1
- package/dist/tools/plan-rollout.js +2 -1
- package/dist/tools/plan-rollout.js.map +1 -1
- package/dist/tools/prepare-codegen-context.d.ts +12 -0
- package/dist/tools/prepare-codegen-context.js +3 -1
- package/dist/tools/prepare-codegen-context.js.map +1 -1
- package/dist/tools/resolve-entities.d.ts +2 -0
- package/dist/tools/resolve-entities.js +5 -1
- package/dist/tools/resolve-entities.js.map +1 -1
- package/dist/tools/select-requirements.d.ts +17 -0
- package/dist/tools/select-requirements.js +19 -4
- package/dist/tools/select-requirements.js.map +1 -1
- package/dist/tools/trace-requirement-sources.d.ts +1 -0
- package/dist/tools/trace-requirement-sources.js +2 -1
- package/dist/tools/trace-requirement-sources.js.map +1 -1
- package/dist/version-info.d.ts +1 -0
- package/dist/version-info.js +23 -0
- package/dist/version-info.js.map +1 -1
- package/package.json +1 -1
package/assets/agent-guide.md
CHANGED
|
@@ -21,8 +21,10 @@ adjacências do grafo, de forma reproduzível e auditável.
|
|
|
21
21
|
É a lista **fechada** de valores que aceito e, para cada valor, **o que ele activa**
|
|
22
22
|
(categorias, capítulos, contagens por nível). É ele que substitui a adivinhação de palavras.
|
|
23
23
|
2. **Mapeia e declara** — `select_sbd_toe_requirements(risk_level, concerns=[…], …)`.
|
|
24
|
-
O
|
|
24
|
+
O enunciado podes enviá-lo à mesma em **`task_context`** (nome canónico desde
|
|
25
|
+
0.20.0-beta.24; `task` continua aceite): fica **registado para auditoria** (`role:
|
|
25
26
|
"recorded_context"`, `affects_selection: false`) e **não influencia o resultado**.
|
|
27
|
+
O campo mudou de nome porque o nome antigo convidava a acreditar que o texto decide.
|
|
26
28
|
3. **Sem declarações** recebes `needs_input`: o vocabulário aplicável, **candidatos A
|
|
27
29
|
CONFIRMAR** derivados do texto (sugestão, nunca selecção) e um exemplo copiável.
|
|
28
30
|
Nunca devolvo zero em silêncio e nunca invento o teu âmbito.
|
|
@@ -148,25 +150,17 @@ Use `search_sbd_toe_manual` for narrative/conceptual questions.
|
|
|
148
150
|
**Output size:** L1 ≈ 22k chars, L2 ≈ 36k chars, L3 ≈ 36k chars (may exceed context).
|
|
149
151
|
**Always use `concerns` to scope L2/L3 queries** — reduces to ~9k chars per concern set.
|
|
150
152
|
|
|
151
|
-
####
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
| `ide` | IDE | Development environment |
|
|
163
|
-
| `requirements` | REQ | Security requirements in SDLC |
|
|
164
|
-
| `architecture` | ARC | Secure architecture |
|
|
165
|
-
| `iac` | IAC | Infrastructure-as-Code |
|
|
166
|
-
| `encryption` | ENC | Cryptography & sensitive data |
|
|
167
|
-
| `agents` | AGN | AI-agent / automation governance — mandate, autonomy A0–A4, kill-switch, intent declaration (`REQ-AGN-001…004`; consult only) |
|
|
168
|
-
|
|
169
|
-
Pass concerns as exact lowercase strings from the table above.
|
|
153
|
+
#### `concerns` — o vocabulário FECHADO desta linha (derivado do bundle)
|
|
154
|
+
|
|
155
|
+
<!-- BEGIN GENERATED: concerns -->
|
|
156
|
+
<!-- END GENERATED: concerns -->
|
|
157
|
+
|
|
158
|
+
#### Os restantes activadores declaráveis
|
|
159
|
+
|
|
160
|
+
<!-- BEGIN GENERATED: activators -->
|
|
161
|
+
<!-- END GENERATED: activators -->
|
|
162
|
+
|
|
163
|
+
|
|
170
164
|
|
|
171
165
|
### GUIDE mode
|
|
172
166
|
Use when the user asks *how to implement, design, structure, document, or review* something
|
|
@@ -192,13 +186,10 @@ get_threat_landscape ← deterministic: threats relevant to a risk level
|
|
|
192
186
|
use for: threat modelling context, "what threats apply to auth?"
|
|
193
187
|
```
|
|
194
188
|
|
|
195
|
-
####
|
|
196
|
-
|
|
197
|
-
Canonical role IDs (pass exact or common alias — resolved automatically):
|
|
189
|
+
#### `role` — papéis aceites por `get_guide_by_role`
|
|
198
190
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
· `ops` · `compliance` · `auditor` · `ir` · `sre`
|
|
191
|
+
<!-- BEGIN GENERATED: roles -->
|
|
192
|
+
<!-- END GENERATED: roles -->
|
|
202
193
|
|
|
203
194
|
#### Interpreting tool output
|
|
204
195
|
|
|
@@ -207,12 +198,14 @@ Canonical role IDs (pass exact or common alias — resolved automatically):
|
|
|
207
198
|
| `rule_trace` contains `CONCERNS_FILTER_REQUIREMENTS` | Tell user scope was narrowed to the specified concerns |
|
|
208
199
|
| `mitigation_confidence: "heuristic"` | Flag as inferred linkage — not structural evidence |
|
|
209
200
|
| `mitigation_confidence: "derived"` | Structural chapter-match — reliable |
|
|
210
|
-
| `
|
|
201
|
+
| `threats: []` **with** `unsupported_concerns` | **Do NOT say "not applicable in this scope".** The concern is valid and its requirements exist — this THREAT MAP does not route it. Cite `unsupported_concerns.note`, then call `select_sbd_toe_requirements` for the same concern; assert nothing about absence of threats |
|
|
202
|
+
| `assignments: []` / `threats: []` **with no** `unsupported_concerns` | Empty *within a resolved scope*: say "manual-grounded: no entries at this risk level for this scope" — do not invent, and do not generalise beyond the scope actually resolved (check `meta.activeChapters` is non-empty before claiming coverage) |
|
|
211
203
|
| `active_domains` | List the security domains active at this risk level |
|
|
212
204
|
| `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 |
|
|
213
205
|
| `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 |
|
|
214
206
|
| `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 |
|
|
215
207
|
| `selection.selected[]` (select) | The recommendation for the task — cite each item's `selection_trace` when asked *why* |
|
|
208
|
+
| `selection.out_of_scope_chapters` (select) | O que **nenhuma declaração activou**, por capítulo e por contagem, com `activate_with` copiável. **Não é «não aplicável»** — é não-perguntado: se o capítulo é relevante para a tarefa, re-chama com a declaração indicada. `SEM ACTIVADOR PUBLICADO` significa que o vocabulário não tem forma de o activar — diz-se, não se inventa |
|
|
216
209
|
| `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 |
|
|
217
210
|
| `completeness_report.selection` (prepare) | The same two-band summary behind the codegen context — `narrowed_out_ref` names the tool to inspect it |
|
|
218
211
|
|
|
@@ -341,54 +334,29 @@ Always distinguish between:
|
|
|
341
334
|
|
|
342
335
|
## Resources
|
|
343
336
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
| `sbd://toe/agent-guide` | This document — full operational guide |
|
|
347
|
-
| `sbd://toe/index-compact` | Full chapter map as JSON — fast structured lookup |
|
|
348
|
-
| `sbd://toe/chapter-applicability/{riskLevel}` | Graduated applicability: every chapter present, per-chapter demand for the level |
|
|
349
|
-
| `sbd://toe/ontology` | Full ontology YAML — domain_mapping, concerns, inference rules |
|
|
350
|
-
| `sbd://toe/version` | Server identity + served knowledge provenance (manual/kg/ontology, from the pin) — read at session start |
|
|
337
|
+
<!-- BEGIN GENERATED: resources -->
|
|
338
|
+
<!-- END GENERATED: resources -->
|
|
351
339
|
|
|
352
340
|
---
|
|
353
341
|
|
|
354
342
|
## Prompts
|
|
355
343
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
| `setup_sbd_toe_agent(riskLevel, projectRole)` | Session setup — active chapters + risk-specific rules. **Prompt MCP** (clientes sem prompts: activadores directos no select) |
|
|
359
|
-
| `ask_sbd_toe_manual(question)` | Direct grounded Q&A |
|
|
344
|
+
<!-- BEGIN GENERATED: prompts -->
|
|
345
|
+
<!-- END GENERATED: prompts -->
|
|
360
346
|
|
|
361
347
|
---
|
|
362
348
|
|
|
363
349
|
## Chapter reference
|
|
364
350
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
| `00-fundamentos` | Fundamentos SbD-ToE | L1 | governance, foundation |
|
|
368
|
-
| `01-classificacao-aplicacoes` | Classificação de Aplicações | L1 | governance, risk |
|
|
369
|
-
| `02-requisitos-seguranca` | Requisitos de Segurança | L1 | governance, requirements |
|
|
370
|
-
| `03-threat-modeling` | Threat Modeling | L1 | risk, architecture |
|
|
371
|
-
| `04-arquitetura-segura` | Arquitetura Segura | L1 | architecture, design |
|
|
372
|
-
| `05-dependencias-sbom-sca` | Dependências, SBOM e SCA | L1 | supply-chain |
|
|
373
|
-
| `06-desenvolvimento-seguro` | Desenvolvimento Seguro | L2 | development, coding |
|
|
374
|
-
| `07-cicd-seguro` | CI/CD Seguro | L1 | devops, pipeline |
|
|
375
|
-
| `08-iac-infraestrutura` | IaC e Infraestrutura | L1 | infrastructure |
|
|
376
|
-
| `09-containers-imagens` | Containers e Imagens | L1 | containers |
|
|
377
|
-
| `10-testes-seguranca` | Testes de Segurança | L1 | testing |
|
|
378
|
-
| `11-deploy-seguro` | Deploy Seguro | L2 | deploy |
|
|
379
|
-
| `12-monitorizacao-operacoes` | Monitorização e Operações | L1 | monitoring |
|
|
380
|
-
| `13-formacao-onboarding` | Formação e Onboarding | L3 | training |
|
|
381
|
-
| `14-governanca-contratacao` | Governança e Contratação | L1 | governance |
|
|
351
|
+
<!-- BEGIN GENERATED: chapters -->
|
|
352
|
+
<!-- END GENERATED: chapters -->
|
|
382
353
|
|
|
383
354
|
---
|
|
384
355
|
|
|
385
356
|
## Risk levels
|
|
386
357
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
| `L1` | Low risk — internal, no sensitive data | ALL chapters — demand mostly recomendado/opcional |
|
|
390
|
-
| `L2` | Medium risk — public APIs, user data | + chapters 06, 11 |
|
|
391
|
-
| `L3` | High risk — PII, regulated systems | + chapter 13 |
|
|
358
|
+
<!-- BEGIN GENERATED: risk-levels -->
|
|
359
|
+
<!-- END GENERATED: risk-levels -->
|
|
392
360
|
|
|
393
361
|
---
|
|
394
362
|
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import readline from "node:readline";
|
|
|
8
8
|
import { getConfig, resolveAppPath } from "./config.js";
|
|
9
9
|
import { formatSampledAnswerResult, inspectManualRetrieval, prepareManualAnsweringContext, searchManualQuestion } from "./orchestrator/ask-manual.js";
|
|
10
10
|
import { loadSystemPromptTemplate } from "./prompt/system-prompt.js";
|
|
11
|
-
import { loadBundleProvenance, servedKgReleaseTag } from "./version-info.js";
|
|
11
|
+
import { loadBundleProvenance, servedKgReleaseTag, servingServerVersion } from "./version-info.js";
|
|
12
12
|
import { handleGetSbdToeChapterBrief, handleListSbdToeChapters, handleMapSbdToeApplicability, handleQuerySbdToeEntities } from "./tools/structured-tools.js";
|
|
13
13
|
import { handleGenerateSbdToeSkill } from "./tools/generate-sbd-toe-skill.js";
|
|
14
14
|
import { handleMapSbdToeReviewScope } from "./tools/map-review-scope.js";
|
|
@@ -38,6 +38,8 @@ const DECLARED_CONCERNS = buildActivationVocabulary().concerns.values.map((c) =>
|
|
|
38
38
|
const CONCERNS_VOCABULARY_NOTE = `Conjunto FECHADO de ${DECLARED_CONCERNS.length} valores, gerado do mesmo vocabulário que sbd://toe/activation-vocabulary publica (com o que cada valor activa e quantos requisitos traz por nível). Valores fora do conjunto são DECLARADOS na resposta (unknown_concerns), nunca descartados em silêncio.`;
|
|
39
39
|
import { buildCodegenInstructionsResourceContent, handlePrepareCodegenContext } from "./tools/prepare-codegen-context.js";
|
|
40
40
|
import { buildChapterApplicabilityJson, buildGroundedCodegenPrompt, buildSetupAgentPrompt, readGroundedCodegenGuide } from "./resources/sbd-toe-resources.js";
|
|
41
|
+
import { RESOURCE_CATALOG, PROMPT_CATALOG } from "./serving/server-surface.js";
|
|
42
|
+
import { buildAgentGuide } from "./serving/agent-guide.js";
|
|
41
43
|
const PROTOCOL_VERSION = "2025-03-26";
|
|
42
44
|
let cachedPackageMetadata;
|
|
43
45
|
const LOG_LEVELS = [
|
|
@@ -70,83 +72,6 @@ function loadPackageMetadata() {
|
|
|
70
72
|
};
|
|
71
73
|
return cachedPackageMetadata;
|
|
72
74
|
}
|
|
73
|
-
/** The single source of the resource surface — resources/list AND the
|
|
74
|
-
* read_sbd_toe_resource tool derive from THIS list (never hardcoded twice). */
|
|
75
|
-
const RESOURCE_CATALOG = [
|
|
76
|
-
{
|
|
77
|
-
uri: "sbd://toe/agent-guide",
|
|
78
|
-
name: "SbD-ToE Agent Guide",
|
|
79
|
-
description: "ENTRY POINT — READ THIS FIRST. Operational guide for AI agents: SbD-ToE identity (Security by Design — Theory of Everything), CONSULT/GUIDE modes, routing by SDLC phase and domain, tool selection, epistemic standards, chapter map, risk levels, identifier conventions.",
|
|
80
|
-
mimeType: "text/markdown"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
uri: "sbd://toe/chapter-applicability/{riskLevel}",
|
|
84
|
-
name: "SbD-ToE Chapter Applicability",
|
|
85
|
-
description: "Graduated chapter applicability for a risk level (L1/L2/L3): presence always, demand scales — derived from authored assignment proportionality (0.14.0).",
|
|
86
|
-
mimeType: "application/json"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
uri: "sbd://toe/activation-vocabulary",
|
|
90
|
-
name: "SbD-ToE Activation Vocabulary",
|
|
91
|
-
description: "DECLARATIVE-FIRST (0.20-beta): the CLOSED vocabulary this server accepts and what each value activates — concerns, exposure, data_sensitivity, technologies, changed_files path table, roles, phases, risk levels. Derived from the served bundle and the engine's own tables, never hand-written. Read it, map your reading of the request onto these values, and DECLARE them: the server answers the declared, it does not interpret prose.",
|
|
92
|
-
mimeType: "application/json"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
uri: "sbd://toe/index-compact",
|
|
96
|
-
name: "SbD-ToE Index Compact",
|
|
97
|
-
description: "Compact JSON index of the manual, DERIVED at read-time from the served bundle (graduated demand_by_level; no minLevel). Injectable into system prompt to eliminate exploratory discovery.",
|
|
98
|
-
mimeType: "application/json"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
uri: "sbd://toe/ontology",
|
|
102
|
-
name: "SbD-ToE Ontology",
|
|
103
|
-
description: "Full SbD-ToE ontology YAML: domain_mapping (requirement category → control domains), " +
|
|
104
|
-
"inference rules with priorities, resolution pipelines (consult/guide/threats/review), " +
|
|
105
|
-
"and entity schemas. Read once per session to understand the deterministic resolution model " +
|
|
106
|
-
"before calling consult_security_requirements, get_threat_landscape or get_guide_by_role.",
|
|
107
|
-
mimeType: "application/yaml"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
uri: "sbd://toe/skill/{role}",
|
|
111
|
-
name: "SbD-ToE Role Skill",
|
|
112
|
-
description: "Role-specialised SbD-ToE skill for a canonical role — RISK LEVEL FIXED AT L2 neste URI; " +
|
|
113
|
-
"para outro nível usa generate_sbd_toe_skill(role, risk_level=…). Same output as generate_sbd_toe_skill(role, format=skill).",
|
|
114
|
-
mimeType: "text/markdown"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
uri: "sbd://toe/subagent/{role}",
|
|
118
|
-
name: "SbD-ToE Role Sub-agent Definition",
|
|
119
|
-
description: "Installable sub-agent definition for a canonical role (default risk L2, harnessed flavour — " +
|
|
120
|
-
"grants mcp__sbd-toe__* tools). Same output as generate_sbd_toe_skill(role, format=subagent).",
|
|
121
|
-
mimeType: "text/markdown"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
uri: "sbd://toe/codegen-instructions/{mode}",
|
|
125
|
-
name: "SbD-ToE Codegen Instructions (per mode)",
|
|
126
|
-
description: "Static per-mode boilerplate of prepare_sbd_toe_codegen_context (mode: codegen, review or " +
|
|
127
|
-
"test-plan): llm_codegen_instructions slots + security_rationale_template skeleton — " +
|
|
128
|
-
"byte-identical to the detail=full inline content when assembled per the embedded rules — " +
|
|
129
|
-
"plus the detail_encoding legend for detail=standard/minimal payloads (v2 token diet). " +
|
|
130
|
-
"Referenced by codegen_instructions_ref in dieted payloads.",
|
|
131
|
-
mimeType: "application/json"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
uri: "sbd://toe/version",
|
|
135
|
-
name: "SbD-ToE MCP Version",
|
|
136
|
-
description: "Version of the running SbD-ToE MCP server (name, version, description) plus the provenance of the served knowledge: manual {version, commit}, kg {release_tag, substrate_version, consumer_contract_version} and ontology {tag, commit}, read from the consumed-bundle pin.",
|
|
137
|
-
mimeType: "application/json"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
uri: "sbd://toe/grounded-codegen-guide",
|
|
141
|
-
name: "SbD-ToE Grounded Codegen Guide",
|
|
142
|
-
description: "Agent-facing guide for using prepare_sbd_toe_codegen_context. " +
|
|
143
|
-
"Covers workflow, branching by status (ready_for_codegen / needs_clarification / " +
|
|
144
|
-
"needs_decomposition / unsupported_scope), output discipline (cite citation_map, fill " +
|
|
145
|
-
"security_rationale, distinguish code/tests/evidence), and explicit prohibitions " +
|
|
146
|
-
"(no invented IDs, no compliance claims, no rastreabilidade-noise inside source files).",
|
|
147
|
-
mimeType: "text/markdown"
|
|
148
|
-
}
|
|
149
|
-
];
|
|
150
75
|
/** Declared resource-read failure (never-silent): carries the JSON-RPC code. */
|
|
151
76
|
/**
|
|
152
77
|
* Materialize any resource of RESOURCE_CATALOG by concrete URI (templated URIs
|
|
@@ -195,7 +120,7 @@ async function materializeResource(uri) {
|
|
|
195
120
|
}
|
|
196
121
|
if (uri === "sbd://toe/agent-guide") {
|
|
197
122
|
try {
|
|
198
|
-
return { mimeType: "text/markdown", text:
|
|
123
|
+
return { mimeType: "text/markdown", text: buildAgentGuide() };
|
|
199
124
|
}
|
|
200
125
|
catch {
|
|
201
126
|
throw new ResourceReadError(-32603, "Could not read SbD-ToE agent guide.");
|
|
@@ -1035,16 +960,21 @@ class McpRuntime {
|
|
|
1035
960
|
title: "Select SbD-ToE Requirements (MP1)",
|
|
1036
961
|
description: "START HERE — para qualquer tarefa concreta esta é a 1ª tool. Arranque: lê sbd://toe/agent-guide (read_sbd_toe_resource); setup_sbd_toe_agent é um PROMPT MCP — clientes sem prompts (p.ex. Desktop) não o expõem: segue directo por aqui. DECLARATIVO PRIMEIRO (contrato v1.18-beta, linha 0.20): TU tens o contexto — lê o pedido, o código e a conversa e DECLARA o que interpretaste (risk_level, concerns, exposure, data_sensitivity, technologies, changed_files). EU NÃO INTERPRETO PROSA: respondo com o que o KG sabe sobre o declarado, mais as adjacências do grafo, de forma reproduzível. Vocabulário fechado em sbd://toe/activation-vocabulary. O `task` fica REGISTADO para auditoria e NÃO influencia o resultado; sem nenhuma declaração devolvo needs_input com o vocabulário e candidatos A CONFIRMAR (nunca adivinho, nunca devolvo zero em silêncio); a baseline do nível pede-se explicitamente (mode='baseline'); o motor inferencial antigo fica em mode='discover' (exploratório). The MP1 selection operation (Classificar → Seleccionar): which requirements apply to THIS task in THIS " +
|
|
1037
962
|
"context. Composes the reference semantics the published ontology declares — baseline (cap. 02 base " +
|
|
1038
|
-
"catalogue, by risk level) ∪ domain chapters activated by the
|
|
1039
|
-
"
|
|
1040
|
-
"
|
|
1041
|
-
"(
|
|
963
|
+
"catalogue, by risk level) ∪ domain chapters activated by the DECLARED activators (concerns, exposure, " +
|
|
964
|
+
"data_sensitivity, technologies, changed_files) ∪ the categories the published vocabulary promises " +
|
|
965
|
+
"⊕ regulatory overlay (extend) — then narrows deterministically by those same declarations. The task " +
|
|
966
|
+
"text is NEVER an activator in declarative mode (it is recorded context; it is only an engine in " +
|
|
967
|
+
"mode='discover'). Returns the bands: selected[] (each with its selection_trace: source/trigger/score), " +
|
|
968
|
+
"narrowed_out[] (eligible-without-signal, grouped by category, with reason), excluded_by_level[] and " +
|
|
969
|
+
"out_of_scope_chapters (what no declaration activated, by chapter and count, with how to bring it in) — " +
|
|
970
|
+
"never silent, and the SCOPE of that promise is the universe, not just the baseline. Paginated. " +
|
|
1042
971
|
"All data from the published deterministic runtime bundle — nothing is invented.",
|
|
1043
972
|
inputSchema: {
|
|
1044
973
|
type: "object",
|
|
1045
974
|
properties: {
|
|
1046
975
|
risk_level: { type: "string", enum: ["L1", "L2", "L3"], description: "Application risk level (drives the baseline)." },
|
|
1047
|
-
|
|
976
|
+
task_context: { type: "string", description: "CONTEXTO REGISTADO (auditoria): o enunciado da tarefa. NOME CANÓNICO desde 0.20.0-beta.24 — um campo chamado `task` convidava a ser o motor, e não é: NÃO influencia a selecção no modo declarativo. Alias `task` continua aceite (aditivo, nunca renomeámos nada); em mode='discover' o texto é motor e `task` é o nome a usar." },
|
|
977
|
+
task: { type: "string", description: "ALIAS de `task_context` (compatibilidade). Em mode='discover' é o MOTOR (casamento lexical, exploratório); no modo declarativo é apenas contexto registado." },
|
|
1048
978
|
mode: { type: "string", enum: ["declarative", "baseline", "discover"], description: "declarative (default): responde ao DECLARADO; sem declarações devolve needs_input com vocabulário e candidatos a confirmar. baseline: baseline completa do nível, por pedido EXPLÍCITO (nunca fallback). discover: motor inferencial histórico (casamento lexical da prosa), exploratório — investigação e estudo de paráfrase." },
|
|
1049
979
|
stack: { type: "string", description: "Texto livre da stack. No modo declarativo só conta quando traz, como TOKEN EXACTO, um valor de `technologies` (normalizar o declarado é legítimo; adivinhar prosa não). Preferir `technologies`." },
|
|
1050
980
|
exposure: { type: "string", enum: ["local", "internal", "authenticated", "public"], description: "Declared activator: authenticated/public activate auth+logging (+api/validation/architecture for public)." },
|
|
@@ -1437,88 +1367,10 @@ class McpRuntime {
|
|
|
1437
1367
|
});
|
|
1438
1368
|
}
|
|
1439
1369
|
getPromptDefinition() {
|
|
1440
|
-
return
|
|
1441
|
-
name: "ask_sbd_toe_manual",
|
|
1442
|
-
title: "Ask SbD-ToE Manual",
|
|
1443
|
-
description: "MCP prompt to guide the AI chat to answer questions about the SbD-ToE manual with grounding.",
|
|
1444
|
-
arguments: [
|
|
1445
|
-
{
|
|
1446
|
-
name: "question",
|
|
1447
|
-
description: "Question about the SbD-ToE manual.",
|
|
1448
|
-
required: true
|
|
1449
|
-
}
|
|
1450
|
-
]
|
|
1451
|
-
};
|
|
1370
|
+
return PROMPT_CATALOG[0];
|
|
1452
1371
|
}
|
|
1453
1372
|
handlePromptsList(request) {
|
|
1454
|
-
this.sendResponse(request.id, {
|
|
1455
|
-
prompts: [
|
|
1456
|
-
this.getPromptDefinition(),
|
|
1457
|
-
{
|
|
1458
|
-
name: "setup_sbd_toe_agent",
|
|
1459
|
-
title: "Setup SbD-ToE Agent",
|
|
1460
|
-
description: "START HERE — entry point (2ª chamada, após leres sbd://toe/agent-guide): MCP PROMPT (clientes sem suporte de prompts não o expõem — alternativa: activadores estruturados directos no select) to configure an agent with SbD-ToE manual context and rules for a given risk level.",
|
|
1461
|
-
arguments: [
|
|
1462
|
-
{
|
|
1463
|
-
name: "riskLevel",
|
|
1464
|
-
description: "Project risk level: L1, L2 or L3.",
|
|
1465
|
-
required: true
|
|
1466
|
-
},
|
|
1467
|
-
{
|
|
1468
|
-
name: "projectRole",
|
|
1469
|
-
description: "Project role or description (optional).",
|
|
1470
|
-
required: false
|
|
1471
|
-
}
|
|
1472
|
-
]
|
|
1473
|
-
},
|
|
1474
|
-
{
|
|
1475
|
-
name: "prepare_grounded_codegen",
|
|
1476
|
-
title: "Prepare Grounded Codegen (SbD-ToE)",
|
|
1477
|
-
description: "MCP prompt that bundles the grounded-codegen guide with a user task and instructs the " +
|
|
1478
|
-
"agent to call prepare_sbd_toe_codegen_context before producing code. Forces citation of " +
|
|
1479
|
-
"citation_map IDs, fills security_rationale_template, distinguishes code/tests/evidence, " +
|
|
1480
|
-
"blocks compliance claims, and routes needs_clarification / needs_decomposition / " +
|
|
1481
|
-
"unsupported_scope to user dialog instead of silent guessing.",
|
|
1482
|
-
arguments: [
|
|
1483
|
-
{
|
|
1484
|
-
name: "task",
|
|
1485
|
-
description: "Concrete coding task (e.g. 'Add payload validation to PATCH /users/:id/email').",
|
|
1486
|
-
required: true
|
|
1487
|
-
},
|
|
1488
|
-
{
|
|
1489
|
-
name: "mode",
|
|
1490
|
-
description: "codegen | review | test-plan. Defaults to codegen.",
|
|
1491
|
-
required: false
|
|
1492
|
-
},
|
|
1493
|
-
{
|
|
1494
|
-
name: "riskLevel",
|
|
1495
|
-
description: "Project risk level: L1, L2 or L3.",
|
|
1496
|
-
required: false
|
|
1497
|
-
},
|
|
1498
|
-
{
|
|
1499
|
-
name: "concerns",
|
|
1500
|
-
description: "Optional explicit concerns (comma-separated string or array). Otherwise inferred by the activation engine.",
|
|
1501
|
-
required: false
|
|
1502
|
-
},
|
|
1503
|
-
{
|
|
1504
|
-
name: "stack",
|
|
1505
|
-
description: "Stack hint (e.g. 'Node.js/Express'). Informational.",
|
|
1506
|
-
required: false
|
|
1507
|
-
},
|
|
1508
|
-
{
|
|
1509
|
-
name: "regulatoryFrameworks",
|
|
1510
|
-
description: "Optional regulatory framework short codes or IDs (e.g. 'GDPR', 'EXT-DORA'). Comma-separated string or array.",
|
|
1511
|
-
required: false
|
|
1512
|
-
},
|
|
1513
|
-
{
|
|
1514
|
-
name: "includeRegulatoryOverlay",
|
|
1515
|
-
description: "When true, asks the tool to surface regulatory overlay context.",
|
|
1516
|
-
required: false
|
|
1517
|
-
}
|
|
1518
|
-
]
|
|
1519
|
-
}
|
|
1520
|
-
]
|
|
1521
|
-
});
|
|
1373
|
+
this.sendResponse(request.id, { prompts: [...PROMPT_CATALOG] });
|
|
1522
1374
|
}
|
|
1523
1375
|
handlePromptGet(request) {
|
|
1524
1376
|
const name = typeof request.params?.name === "string" ? request.params.name : "";
|
|
@@ -2077,6 +1929,7 @@ class McpRuntime {
|
|
|
2077
1929
|
size_estimate: { chars: text.length, approx_tokens: Math.ceil(text.length / 4) },
|
|
2078
1930
|
provenance: {
|
|
2079
1931
|
kg: servedKgReleaseTag(),
|
|
1932
|
+
server: servingServerVersion(),
|
|
2080
1933
|
content_type: "canonical",
|
|
2081
1934
|
produced_by: "resources_read_mirror",
|
|
2082
1935
|
source_data: uriArg,
|