kibi-cli 2.29.0 → 2.31.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/dist/cli-operation-metadata.d.ts +8 -8
- package/dist/cli-operation-metadata.js +8 -8
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +35 -2
- package/dist/commands/check-certificates.d.ts +52 -0
- package/dist/commands/check-certificates.d.ts.map +1 -0
- package/dist/commands/check-certificates.js +163 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +4 -0
- package/dist/commands/discovery-table.d.ts.map +1 -1
- package/dist/commands/discovery-table.js +14 -2
- package/dist/commands/report.js +3 -3
- package/dist/commands/signoff.d.ts +37 -0
- package/dist/commands/signoff.d.ts.map +1 -0
- package/dist/commands/signoff.js +155 -0
- package/dist/operations/modeling/predicate-applicability.d.ts +5 -1
- package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applicability.js +35 -2
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +3 -1
- package/dist/operations/mutation/contradictions.d.ts +7 -5
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +8 -6
- package/dist/operations/mutation/source-authoring.d.ts +15 -0
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +19 -7
- package/dist/operations/mutation/types.d.ts +5 -0
- package/dist/operations/mutation/types.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.d.ts +14 -0
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +42 -36
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +61 -37
- package/dist/operations/planning/apply-plan.js +5 -5
- package/dist/operations/proof/baseline-diff.d.ts +1 -1
- package/dist/operations/proof/baseline-diff.js +1 -1
- package/dist/operations/proof/impact.d.ts +10 -4
- package/dist/operations/proof/impact.d.ts.map +1 -1
- package/dist/operations/proof/impact.js +27 -7
- package/dist/public/diagnostic-usage.js +2 -2
- package/dist/public/operations/catalog.d.ts +31 -10
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +2 -0
- package/dist/public/operations/specs/bootstrap.d.ts +1 -1
- package/dist/public/operations/specs/bootstrap.js +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.js +3 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/composite.d.ts +1 -1
- package/dist/public/operations/specs/composite.js +1 -1
- package/dist/public/operations/specs/discovery.d.ts +1 -1
- package/dist/public/operations/specs/discovery.js +1 -1
- package/dist/public/operations/specs/impact-review-preparation.d.ts +2 -1
- package/dist/public/operations/specs/impact-review-preparation.d.ts.map +1 -1
- package/dist/public/operations/specs/impact-review-preparation.js +2 -1
- package/dist/public/operations/specs/planning.d.ts +1 -1
- package/dist/public/operations/specs/planning.js +1 -1
- package/dist/public/operations/specs/reporting.d.ts +25 -5
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +102 -26
- package/dist/public/skills/kibi-commit-review/SKILL.md +125 -0
- package/dist/public/skills/kibi-commit-review/resources/staged-gate.md +98 -0
- package/dist/public/skills/kibi-decisions/SKILL.md +130 -0
- package/dist/public/skills/kibi-decisions/resources/decision-records.md +142 -0
- package/dist/public/skills/kibi-decisions/resources/signoff-views.md +66 -0
- package/dist/public/skills/kibi-freshness/SKILL.md +3 -1
- package/dist/public/skills/kibi-traceability/SKILL.md +4 -0
- package/dist/public/skills/kibi-usage/SKILL.md +21 -16
- package/dist/public/skills/kibi-usage/resources/proof.md +36 -4
- package/dist/public/skills/kibi-usage/resources/workflows.md +1 -1
- package/dist/report/html-report.css +11 -4
- package/dist/report/html-report.d.ts +2 -2
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +27 -21
- package/dist/report/report-view.d.ts +2 -2
- package/dist/report/report-view.js +2 -2
- package/dist/signoff/collect.d.ts +39 -0
- package/dist/signoff/collect.d.ts.map +1 -0
- package/dist/signoff/collect.js +402 -0
- package/dist/signoff/html.d.ts +4 -0
- package/dist/signoff/html.d.ts.map +1 -0
- package/dist/signoff/html.js +210 -0
- package/dist/signoff/markdown.d.ts +20 -0
- package/dist/signoff/markdown.d.ts.map +1 -0
- package/dist/signoff/markdown.js +203 -0
- package/dist/signoff/model.d.ts +139 -0
- package/dist/signoff/model.d.ts.map +1 -0
- package/dist/signoff/model.js +142 -0
- package/dist/traceability/staged-consistency.d.ts.map +1 -1
- package/dist/traceability/staged-consistency.js +3 -1
- package/dist/utils/rule-registry.generated.d.ts +10 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +12 -0
- package/package.json +2 -2
- package/src/public/diagnostic-usage.ts +3 -3
- package/src/public/operations/contracts.ts +2 -0
- package/src/public/operations/specs/bootstrap.ts +1 -1
- package/src/public/operations/specs/check-rules.generated.ts +3 -1
- package/src/public/operations/specs/composite.ts +1 -1
- package/src/public/operations/specs/discovery.ts +1 -1
- package/src/public/operations/specs/impact-review-preparation.ts +3 -1
- package/src/public/operations/specs/planning.ts +1 -1
- package/src/public/operations/specs/reporting.ts +114 -26
- package/src/public/skills/kibi-commit-review/SKILL.md +125 -0
- package/src/public/skills/kibi-commit-review/resources/staged-gate.md +98 -0
- package/src/public/skills/kibi-decisions/SKILL.md +130 -0
- package/src/public/skills/kibi-decisions/resources/decision-records.md +142 -0
- package/src/public/skills/kibi-decisions/resources/signoff-views.md +66 -0
- package/src/public/skills/kibi-freshness/SKILL.md +3 -1
- package/src/public/skills/kibi-traceability/SKILL.md +4 -0
- package/src/public/skills/kibi-usage/SKILL.md +21 -16
- package/src/public/skills/kibi-usage/resources/proof.md +36 -4
- package/src/public/skills/kibi-usage/resources/workflows.md +1 -1
- package/templates/github/kibi-badge.yml +1 -1
|
@@ -259,7 +259,7 @@ export const statusSpec = {
|
|
|
259
259
|
name: "kb_status",
|
|
260
260
|
cliName: "status",
|
|
261
261
|
description:
|
|
262
|
-
"Report current branch, KB snapshot, freshness metadata, schema status, and a typed kibi.migration-plan.v2 action graph. Read-only status inspection with no mutation side effects; damaged stores are diagnosed without starting the engine.",
|
|
262
|
+
"Report current branch, KB snapshot, freshness metadata, schema status, and a typed kibi.migration-plan.v2 action graph. Call it first to orient on a branch or after a failed call; use kb_check for validation findings and kb_coverage for proof status. Read-only status inspection with no mutation side effects; damaged stores are diagnosed without starting the engine.",
|
|
263
263
|
businessInputSchema: { type: "object", properties: {} },
|
|
264
264
|
// Status must remain available when the branch store cannot be attached.
|
|
265
265
|
requiresProlog: false,
|
|
@@ -5,13 +5,15 @@ export const prepareImpactReviewSpec = {
|
|
|
5
5
|
name: "kb_prepare_impact_review",
|
|
6
6
|
cliName: "prepare-impact-review",
|
|
7
7
|
description:
|
|
8
|
-
"Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.",
|
|
8
|
+
"Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Use it when kb_check reports that changed files need an impact review; it does not plan KB changes. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.",
|
|
9
9
|
businessInputSchema: {
|
|
10
10
|
type: "object",
|
|
11
11
|
additionalProperties: false,
|
|
12
12
|
required: ["scope"],
|
|
13
13
|
properties: {
|
|
14
14
|
scope: {
|
|
15
|
+
description:
|
|
16
|
+
'What to review: {"kind":"staged"} for the staged snapshot, or {"kind":"diff","baseCommit":"<sha>","headCommit":"<sha>"} with full commit hashes.',
|
|
15
17
|
oneOf: [
|
|
16
18
|
{
|
|
17
19
|
type: "object",
|
|
@@ -35,7 +35,7 @@ export const compileIntentSpec = {
|
|
|
35
35
|
name: "kb_compile_intent",
|
|
36
36
|
cliName: "compile-intent",
|
|
37
37
|
description:
|
|
38
|
-
"Compile complete change intent into a deterministic, snapshot-bound read-only plan. Reuses intent-aware discovery and semantic modeling, accounts for every proposition, reports contradiction witnesses, proposes traceability links, and emits dependency-ordered kb_upsert-style steps only for resolved typed claims. contradictionAnalysis.outcome is no_conflict only when the check could decide: an unmodeled proposition or a related current requirement without logic leaves it unresolved with reasons and reviewCandidates to compare and judge through conflictReviews. No mutation side effects.",
|
|
38
|
+
"Compile complete change intent into a deterministic, snapshot-bound read-only plan. Use it before editing code for a change request that may touch several requirements; use kb_model for one requirement's prose and kb_plan_bootstrap for first-time onboarding. Reuses intent-aware discovery and semantic modeling, accounts for every proposition, reports contradiction witnesses, proposes traceability links, and emits dependency-ordered kb_upsert-style steps only for resolved typed claims. contradictionAnalysis.outcome is no_conflict only when the check could decide: an unmodeled proposition or a related current requirement without logic leaves it unresolved with reasons and reviewCandidates to compare and judge through conflictReviews. No mutation side effects.",
|
|
39
39
|
businessInputSchema: {
|
|
40
40
|
type: "object",
|
|
41
41
|
required: ["intent", "mode"],
|
|
@@ -118,7 +118,7 @@ function validateEntityType(type?: string): void {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
const COVERAGE_PROOF_STATUSES: ReadonlySet<string> = new Set([
|
|
121
|
-
"
|
|
121
|
+
"tested",
|
|
122
122
|
"missing",
|
|
123
123
|
"unresolved",
|
|
124
124
|
"not_applicable",
|
|
@@ -173,20 +173,47 @@ export const findGapsSpec = {
|
|
|
173
173
|
name: "kb_find_gaps",
|
|
174
174
|
cliName: "find-gaps",
|
|
175
175
|
description:
|
|
176
|
-
"
|
|
176
|
+
"List KB entities by the relationships they lack or have. Use for questions like which requirements lack scenarios or tests; all filters must match, and a relationship counts in either direction. Use kb_coverage instead for proof status and repair plans, and kb_check for rule violations. No mutation side effects.",
|
|
177
177
|
businessInputSchema: {
|
|
178
178
|
type: "object",
|
|
179
179
|
properties: {
|
|
180
180
|
type: {
|
|
181
181
|
type: "string",
|
|
182
182
|
enum: ENTITY_TYPES,
|
|
183
|
+
description: "Only report entities of this type. Omit for all types.",
|
|
184
|
+
},
|
|
185
|
+
missingRelationships: {
|
|
186
|
+
type: "array",
|
|
187
|
+
items: { type: "string" },
|
|
188
|
+
description:
|
|
189
|
+
"Relationship types the entity must have none of, in either direction, for example specified_by or verified_by. verified_by and validates satisfy each other.",
|
|
190
|
+
},
|
|
191
|
+
presentRelationships: {
|
|
192
|
+
type: "array",
|
|
193
|
+
items: { type: "string" },
|
|
194
|
+
description:
|
|
195
|
+
"Relationship types the entity must have at least one of each, in either direction.",
|
|
196
|
+
},
|
|
197
|
+
tags: {
|
|
198
|
+
type: "array",
|
|
199
|
+
items: { type: "string" },
|
|
200
|
+
description:
|
|
201
|
+
"Keep entities carrying any of these metadata tags. Bootstrap provenance stubs appear in rows only when this names bootstrap:provenance-stub.",
|
|
202
|
+
},
|
|
203
|
+
sourceFile: {
|
|
204
|
+
type: "string",
|
|
205
|
+
description: "Keep entities whose source path contains this substring.",
|
|
206
|
+
},
|
|
207
|
+
limit: {
|
|
208
|
+
type: "integer",
|
|
209
|
+
default: 100,
|
|
210
|
+
description: "Maximum rows to return; count reports the full total.",
|
|
211
|
+
},
|
|
212
|
+
offset: {
|
|
213
|
+
type: "integer",
|
|
214
|
+
default: 0,
|
|
215
|
+
description: "Zero-based row offset for pagination.",
|
|
183
216
|
},
|
|
184
|
-
missingRelationships: { type: "array", items: { type: "string" } },
|
|
185
|
-
presentRelationships: { type: "array", items: { type: "string" } },
|
|
186
|
-
tags: { type: "array", items: { type: "string" } },
|
|
187
|
-
sourceFile: { type: "string" },
|
|
188
|
-
limit: { type: "integer", default: 100 },
|
|
189
|
-
offset: { type: "integer", default: 0 },
|
|
190
217
|
},
|
|
191
218
|
},
|
|
192
219
|
requiresProlog: true,
|
|
@@ -200,7 +227,7 @@ export const findGapsSpec = {
|
|
|
200
227
|
* + bound-symbol code scope) and hand the Prolog coverage stage a
|
|
201
228
|
* TestId -> BindingHash dict. This is the default binding mode since slice 3;
|
|
202
229
|
* KIBI_PROOF_BINDING_MODE=strict-snapshot opts out (receipts then match only
|
|
203
|
-
* against the whole-workspace snapshot they were
|
|
230
|
+
* against the whole-workspace snapshot they were produced on).
|
|
204
231
|
*/
|
|
205
232
|
// implements REQ-kibi-verification-evidence-contract
|
|
206
233
|
export function currentProofBindingMode(): "per_contract" | "strict_snapshot" {
|
|
@@ -404,13 +431,13 @@ export async function executeCoverage(
|
|
|
404
431
|
},
|
|
405
432
|
};
|
|
406
433
|
const fullyCovered = Number(enrichedPayload.summary?.fullyCovered ?? 0);
|
|
407
|
-
const
|
|
434
|
+
const proofTested = Number(enrichedPayload.summary?.proofTested ?? 0);
|
|
408
435
|
const total = Number(enrichedPayload.summary?.total ?? 0);
|
|
409
436
|
return {
|
|
410
437
|
content: [
|
|
411
438
|
{
|
|
412
439
|
type: "text",
|
|
413
|
-
text: `Coverage summary: ${fullyCovered} structurally covered and ${
|
|
440
|
+
text: `Coverage summary: ${fullyCovered} structurally covered and ${proofTested} tested end to end out of ${total}.`,
|
|
414
441
|
},
|
|
415
442
|
],
|
|
416
443
|
structuredContent: enrichedPayload,
|
|
@@ -425,25 +452,55 @@ export const coverageSpec = {
|
|
|
425
452
|
name: "kb_coverage",
|
|
426
453
|
cliName: "coverage",
|
|
427
454
|
description:
|
|
428
|
-
"Generate curated structural coverage and conservative end-to-end requirement proof reports for requirements, symbols, or grouped types. Reports include the compatible repair plan plus typed kibi.migration-plan.v2 actions; semantic and E2E actions remain review/execution work. Paginated plans identify incomplete scope and no mutation occurs.",
|
|
455
|
+
"Generate curated structural coverage and conservative end-to-end requirement proof reports for requirements, symbols, or grouped types. Use it to ask which requirements are tested end to end, how strong each requirement's evidence is (evidenceLevel: proved, tested, asserted or unverified), and what blocks the rest; use kb_find_gaps for a plain list of missing links and kb_check for rule violations. Reports include the compatible repair plan plus typed kibi.migration-plan.v2 actions; semantic and E2E actions remain review/execution work. Paginated plans identify incomplete scope and no mutation occurs.",
|
|
429
456
|
businessInputSchema: {
|
|
430
457
|
type: "object",
|
|
431
458
|
properties: {
|
|
432
|
-
by: {
|
|
433
|
-
|
|
434
|
-
|
|
459
|
+
by: {
|
|
460
|
+
type: "string",
|
|
461
|
+
enum: ["req", "symbol", "type"],
|
|
462
|
+
default: "req",
|
|
463
|
+
description:
|
|
464
|
+
"Report shape: req gives per-requirement proof status and a repair plan, symbol gives per-symbol ownership coverage, type gives counts per entity type.",
|
|
465
|
+
},
|
|
466
|
+
tags: {
|
|
467
|
+
type: "array",
|
|
468
|
+
items: { type: "string" },
|
|
469
|
+
description:
|
|
470
|
+
"Keep rows for entities carrying any of these metadata tags.",
|
|
471
|
+
},
|
|
472
|
+
includePassing: {
|
|
473
|
+
type: "boolean",
|
|
474
|
+
default: false,
|
|
475
|
+
description:
|
|
476
|
+
"Also return rows that are already tested or not applicable. By default only rows that still need repair are returned.",
|
|
477
|
+
},
|
|
435
478
|
statuses: {
|
|
436
479
|
type: "array",
|
|
437
480
|
items: {
|
|
438
481
|
type: "string",
|
|
439
|
-
enum: ["
|
|
482
|
+
enum: ["tested", "missing", "unresolved", "not_applicable"],
|
|
440
483
|
},
|
|
441
484
|
description:
|
|
442
485
|
"Requirement proof-status filter (req mode): include only rows whose proofStatus is listed. Selecting statuses implies include-passing; not_applicable rows carry their typed applicability reason in proofStages.applicability.reason. The summary always reflects the whole KB.",
|
|
443
486
|
},
|
|
444
|
-
includeTransitive: {
|
|
445
|
-
|
|
446
|
-
|
|
487
|
+
includeTransitive: {
|
|
488
|
+
type: "boolean",
|
|
489
|
+
default: true,
|
|
490
|
+
description:
|
|
491
|
+
"Count symbol coverage reached transitively through linked entities, not only direct links.",
|
|
492
|
+
},
|
|
493
|
+
limit: {
|
|
494
|
+
type: "integer",
|
|
495
|
+
default: 100,
|
|
496
|
+
description:
|
|
497
|
+
"Maximum rows to return. When the repair plan reports scope.complete false, rerun with offset 0 and a larger limit.",
|
|
498
|
+
},
|
|
499
|
+
offset: {
|
|
500
|
+
type: "integer",
|
|
501
|
+
default: 0,
|
|
502
|
+
description: "Zero-based row offset for pagination.",
|
|
503
|
+
},
|
|
447
504
|
includeMigrationPreview: {
|
|
448
505
|
type: "boolean",
|
|
449
506
|
default: false,
|
|
@@ -526,22 +583,53 @@ export const graphSpec = {
|
|
|
526
583
|
name: "kb_graph",
|
|
527
584
|
cliName: "graph",
|
|
528
585
|
description:
|
|
529
|
-
"Run bounded graph traversal from one or more seed IDs across curated relationship types. No mutation side effects.",
|
|
586
|
+
"Run bounded graph traversal from one or more seed IDs across curated relationship types and return the nodes and edges reached. Use it to follow links from IDs you already have, such as a requirement to its scenarios and tests or a symbol to the requirements it implements; use kb_query to find entities by filter and kb_search to ask a question. Traversal stops at depth, maxNodes or maxEdges and then sets truncated. No mutation side effects.",
|
|
530
587
|
businessInputSchema: {
|
|
531
588
|
type: "object",
|
|
532
589
|
required: ["seedIds"],
|
|
533
590
|
properties: {
|
|
534
|
-
seedIds: {
|
|
535
|
-
|
|
591
|
+
seedIds: {
|
|
592
|
+
type: "array",
|
|
593
|
+
items: { type: "string" },
|
|
594
|
+
description:
|
|
595
|
+
"Entity IDs to start from, for example REQ-... or SCEN-.... Seeds are always returned as nodes.",
|
|
596
|
+
},
|
|
597
|
+
relationships: {
|
|
598
|
+
type: "array",
|
|
599
|
+
items: { type: "string" },
|
|
600
|
+
description:
|
|
601
|
+
"Relationship types to follow, for example specified_by, verified_by or implements. Omit to follow every relationship type.",
|
|
602
|
+
},
|
|
536
603
|
direction: {
|
|
537
604
|
type: "string",
|
|
538
605
|
enum: ["outgoing", "incoming", "both"],
|
|
539
606
|
default: "outgoing",
|
|
607
|
+
description:
|
|
608
|
+
"outgoing follows links from each node, incoming follows links pointing at it, both does either.",
|
|
609
|
+
},
|
|
610
|
+
depth: {
|
|
611
|
+
type: "integer",
|
|
612
|
+
default: 1,
|
|
613
|
+
minimum: 1,
|
|
614
|
+
maximum: 5,
|
|
615
|
+
description: "Number of hops from the seeds.",
|
|
616
|
+
},
|
|
617
|
+
entityTypes: {
|
|
618
|
+
type: "array",
|
|
619
|
+
items: { type: "string" },
|
|
620
|
+
description:
|
|
621
|
+
"Keep only nodes of these types (req, scenario, test, adr, flag, event, symbol, fact) in the result, and the edges between them. Traversal still passes through other types.",
|
|
622
|
+
},
|
|
623
|
+
maxNodes: {
|
|
624
|
+
type: "integer",
|
|
625
|
+
default: 200,
|
|
626
|
+
description: "Stop and set truncated once this many nodes are reached.",
|
|
627
|
+
},
|
|
628
|
+
maxEdges: {
|
|
629
|
+
type: "integer",
|
|
630
|
+
default: 500,
|
|
631
|
+
description: "Stop and set truncated once this many edges are reached.",
|
|
540
632
|
},
|
|
541
|
-
depth: { type: "integer", default: 1, minimum: 1, maximum: 5 },
|
|
542
|
-
entityTypes: { type: "array", items: { type: "string" } },
|
|
543
|
-
maxNodes: { type: "integer", default: 200 },
|
|
544
|
-
maxEdges: { type: "integer", default: 500 },
|
|
545
633
|
},
|
|
546
634
|
},
|
|
547
635
|
requiresProlog: true,
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: kibi-commit-review
|
|
3
|
+
name: kibi-commit-review
|
|
4
|
+
description: "Use when kibi check --staged or the Kibi pre-commit hook blocks a commit (kibi_impact_evidence_missing, symbols_manifest_stale, symbol_granularity_violation, symbol-coverage, kibi check-generated drift, Staged impact review failed), or when preparing a commit or pull-request impact review. Covers reading the per-file Detail lines, authoring .kb/symbols.yaml symbol entries through kb_upsert, kibi sync --refresh-symbol-coordinates, staging the tracked Kibi evidence with git add, kb_prepare_impact_review for a staged or diff scope, the kibi signoff requirements summary to show before a commit, and how merge commits and migration renames are judged."
|
|
5
|
+
version: 1.2.0
|
|
6
|
+
kibiCompatibility: ">=1.0.0"
|
|
7
|
+
tags:
|
|
8
|
+
- kibi
|
|
9
|
+
- commit
|
|
10
|
+
- staged-check
|
|
11
|
+
- traceability
|
|
12
|
+
- agent-guidance
|
|
13
|
+
resources:
|
|
14
|
+
- resources/staged-gate.md
|
|
15
|
+
---
|
|
16
|
+
## Goal
|
|
17
|
+
|
|
18
|
+
Get a commit through Kibi's staged gate by fixing the cause: the commit
|
|
19
|
+
carries the knowledge its behavior change needs, with current symbol
|
|
20
|
+
coordinates, so the gate passes for the same reason a reviewer would accept it.
|
|
21
|
+
|
|
22
|
+
## Interface Selection
|
|
23
|
+
|
|
24
|
+
Use the visible approved MCP tools or the trusted project-local CLI as equal
|
|
25
|
+
peer interfaces (CLI JSON: `printf '%s\n' '{}' | npx --no-install kibi status
|
|
26
|
+
--input -`). The gate itself is CLI: `npx --no-install kibi check --staged`
|
|
27
|
+
(add `--format json` for the full evidence). If neither surface is available,
|
|
28
|
+
stop and name the missing capability. Never read or edit `.kb/` files directly.
|
|
29
|
+
|
|
30
|
+
## When this applies
|
|
31
|
+
|
|
32
|
+
- `kibi check --staged` fails, or the pre-commit hook (`kibi check-generated
|
|
33
|
+
--staged --changed-only`, then `kibi check --staged`) blocks a commit.
|
|
34
|
+
- You are about to commit or open a pull request and want the impact review
|
|
35
|
+
ready first.
|
|
36
|
+
|
|
37
|
+
Never read or open any file under `.kb`, not even read-only with a file tool to look at symbols or coordinates; doing so fails the session even when nothing is written. What you need is already shown elsewhere: the gate's `Detail:` lines, `kb_query` by `sourceFile` or `id`, and `kb_check` with `staged: true` show which symbols and coordinates are covered and which are missing. Before deciding what the change is, always run `kb_search` with `sourceLocations` for each named file and `kb_query` the requirement that governs it, even when the edit looks coordinate-only or seems to contradict a firm rule. When a write is authorized, keep the supplied target and its intended edges, query those targets first, validate the exact payload with `kb_upsert` and `dryRun: true`, then send that same payload with `kb_upsert` and exact-read the result back with `kb_query` before the final checks. Distinct authorized payloads may need several sequential writes, but never resend a write that is already committed, and let typed `nextActions` drive recovery. A passing dry run is validation only, not completion.
|
|
38
|
+
|
|
39
|
+
## Steps
|
|
40
|
+
|
|
41
|
+
1. **Read the whole failure.** Each finding names an id, the files, `Detail:`
|
|
42
|
+
lines and a `Suggestion:`. Detail lines are complete per file: how many
|
|
43
|
+
symbols extraction finds in the staged content, how many the staged
|
|
44
|
+
evidence covers, and every symbol missing from `.kb/symbols.yaml` with its
|
|
45
|
+
line. The common ids and their fixes are in `resources/staged-gate.md`.
|
|
46
|
+
2. **Find the owning knowledge.** `kb_search` with `sourceLocations` for each
|
|
47
|
+
named file (or `kb_query({sourceFile})`), then `kb_query` the requirements,
|
|
48
|
+
scenarios and tests it returns. Run `kb_check` with `sourceFiles`,
|
|
49
|
+
`includeImpactDiagnostics: true` and `staged: true` to see the impact
|
|
50
|
+
findings, including `requirement_statement_unverified` quotes.
|
|
51
|
+
3. **Decide what the change is.**
|
|
52
|
+
- Behavior changed: update or record the knowledge (a requirement with a
|
|
53
|
+
scenario, or a new clause) through `kb_upsert`. If the change contradicts
|
|
54
|
+
a recorded rule, stop and ask; load `kibi-decisions`.
|
|
55
|
+
- New or uncovered symbols: author a `symbol` entity per listed symbol
|
|
56
|
+
through `kb_upsert` (`title` = the member the extractor names,
|
|
57
|
+
`sourceFile`, `status: active`, `symbol_role: behavioral`, `implements`
|
|
58
|
+
to the requirement, `covered_by` to the test). Then run
|
|
59
|
+
`kibi sync --refresh-symbol-coordinates`.
|
|
60
|
+
- Only coordinates moved: `kibi sync --refresh-symbol-coordinates`.
|
|
61
|
+
- No behavior change (a genuine false positive): see the audited
|
|
62
|
+
no-impact note in `resources/staged-gate.md`; it never covers a real
|
|
63
|
+
behavior change.
|
|
64
|
+
4. **Stage the evidence.** Kibi authors tracked files but never Git-stages or
|
|
65
|
+
commits them. `git status --short .kb` lists what it wrote; `git add` the
|
|
66
|
+
entity Markdown, `.kb/relationships/` shards, `.kb/symbols.yaml` and
|
|
67
|
+
`.kb/symbol-coordinates.yaml` that belong to this change (use `git add -p`
|
|
68
|
+
when the files hold unrelated edits).
|
|
69
|
+
5. **Re-run** `kibi check --staged` (and `kibi check-generated --staged` when it
|
|
70
|
+
failed) until it passes. Never bypass the hook (`--no-verify`) unless the
|
|
71
|
+
person says so.
|
|
72
|
+
|
|
73
|
+
## Requirements signoff
|
|
74
|
+
|
|
75
|
+
Before you ask the person to approve a commit that adds, rewrites or retires
|
|
76
|
+
requirements, or changes code that implements them, show them what they are
|
|
77
|
+
signing off:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
npx --no-install kibi signoff # working tree; --staged for the index
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
It prints Markdown listing each new, changed, affected and retired
|
|
84
|
+
requirement with its statement (before and after for a rewrite), firmness,
|
|
85
|
+
origin, scenarios and proof state. Put it in your reply unchanged (in the
|
|
86
|
+
messaging tool's message when replies go through one), then add one or two
|
|
87
|
+
sentences on why the requirements changed. Offer the full page with
|
|
88
|
+
`kibi signoff --format html --open`, or attach or publish
|
|
89
|
+
`.kb/briefs/signoff/latest.html` when your host can carry a file or a page;
|
|
90
|
+
past 15 requirements the Markdown stops and only the page lists them all.
|
|
91
|
+
Host details: `kibi-decisions`, `resources/signoff-views.md`. `--no-proof` skips the proof lookup, which reads coverage and is slow
|
|
92
|
+
on a large knowledge base. The summary is not an approval: never set
|
|
93
|
+
`approved_by` or `origin.ref` from it.
|
|
94
|
+
|
|
95
|
+
## Impact reviews
|
|
96
|
+
|
|
97
|
+
When the repository's base commit carries `.kibi/impact-policy.json`, the gate
|
|
98
|
+
also demands a content-bound review record at `.kibi/impact-review.json`
|
|
99
|
+
(`Staged impact review failed: impact_review_invalid ...`). Prepare it with
|
|
100
|
+
`kb_prepare_impact_review` (`scope: {"kind":"staged"}`, or `{"kind":"diff",
|
|
101
|
+
"baseCommit":"<40-hex sha>","headCommit":"<40-hex sha>"}` for a pull
|
|
102
|
+
request). It is read-only: it returns per-file evidence, requirement scopes,
|
|
103
|
+
residual review obligations and an unauthored record template. Draft each
|
|
104
|
+
file's `decision` from what you verified, leave `reviewer.id` for the person
|
|
105
|
+
who reviews, and never present the record as their approval. Field details are
|
|
106
|
+
in `resources/staged-gate.md`.
|
|
107
|
+
|
|
108
|
+
## Merge commits and migrations
|
|
109
|
+
|
|
110
|
+
During a merge (`MERGE_HEAD` exists), files staged unchanged from a merged
|
|
111
|
+
parent are skipped (`Merge commit: N staged file(s) are taken unchanged ...`);
|
|
112
|
+
only what the merge resolved or edited is judged. A commit that moves
|
|
113
|
+
knowledge into `.kb/` after `kibi migrate` is compared with the old paths
|
|
114
|
+
(`Baseline: HEAD with N staged knowledge rename(s) ...`), and symbol records
|
|
115
|
+
changed only by the migration are not judged as changed. Debt reported there
|
|
116
|
+
came from the branch or the old layout; the full `kibi check` still shows it.
|
|
117
|
+
|
|
118
|
+
## Typed results and report
|
|
119
|
+
|
|
120
|
+
Parse `kibiProtocol`, `status`, diagnostics and typed `nextActions` on every
|
|
121
|
+
Kibi write. On `committed_with_repairs`, run the repair actions and never
|
|
122
|
+
resend the original write. Report the findings you fixed (id, file, what
|
|
123
|
+
changed), the knowledge you recorded or confirmed still current, the files
|
|
124
|
+
you staged, the final `kibi check --staged` result, and anything left for the
|
|
125
|
+
person (an open rule conflict, an unauthored review decision).
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# The staged gate
|
|
2
|
+
|
|
3
|
+
Reference for `kibi-commit-review`: what `kibi check --staged` and
|
|
4
|
+
`kibi check-generated --staged` report, how to fix each finding, and the
|
|
5
|
+
impact-review record. The staged check reads blob content from the Git index,
|
|
6
|
+
not the working tree, so a fix counts only once it is staged.
|
|
7
|
+
|
|
8
|
+
## Reading a finding
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
symbols_manifest_stale: .kb/symbol-coordinates.yaml is stale or missing for staged source files: src/billing/refund.ts
|
|
12
|
+
Detail: src/billing/refund.ts — extraction finds 4 symbol(s), evidence covers 3.
|
|
13
|
+
Not in .kb/symbols.yaml: approveRefund (line 42)
|
|
14
|
+
Suggestion: Author .kb/symbols.yaml entries for the uncovered symbols (kibi upsert, with implements/covered_by links), then run kibi sync --refresh-symbol-coordinates && git add .kb/symbol-coordinates.yaml .kb/symbols.yaml, then re-run kibi check --staged.
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- Detail lines name every symbol, never a shortened list. `Evidence without a
|
|
18
|
+
matching symbol:` lists manifest entries whose declaration is gone or
|
|
19
|
+
renamed: rename the symbol's `title`, or retire the entry.
|
|
20
|
+
- `--format json` carries the same lists in the diagnostic `evidence`
|
|
21
|
+
(`symbolsManifest[].missing` / `extra`, `uncoveredSymbols[].titles`).
|
|
22
|
+
|
|
23
|
+
## Blocking findings
|
|
24
|
+
|
|
25
|
+
| Id or message | Cause | Fix |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| `kibi_impact_evidence_missing` | A staged behavior edit (changed lines in exported or behavior-bearing code, not comments or formatting) has no staged Kibi evidence. Test-only edits do not need it unless they add executable test symbols. | Query the owning knowledge; update it when behavior changed; stage entity Markdown under `.kb/`, authored `.kb/symbols.yaml` entries for the listed symbols, or refreshed `.kb/symbol-coordinates.yaml`. |
|
|
28
|
+
| `symbols_manifest_stale` | Extraction output changed and the staged coordinates (or manifest) do not match it. | Author entries for the listed symbols first, then `kibi sync --refresh-symbol-coordinates`, then stage both manifests. |
|
|
29
|
+
| `symbol_granularity_violation` | A changed behavioral member is owned only by a coarse class or module symbol while a narrower declaration exists. | Add a symbol for the member itself (`title` = `Class.method` or the exported function) with its own links; use `granularity_reason` (`config-artifact`, `module-level-behavior`, `extractor-miss`, `legacy-link`, `test-suite`) only when it is true. |
|
|
30
|
+
| `symbol-coverage` | A changed symbol, or a symbol whose staged manifest entry changed, fails the full-check rule on the staged knowledge. | The symbol `implements` the requirement and is `covered_by` a test that verifies it: through the requirement's scenario (`verified_by` scenario -> test) when it has one, else `verified_by` requirement -> test. A direct requirement -> test link does not count while a scenario exists. The finding's suggestion names the missing link (see `kibi-traceability`). |
|
|
31
|
+
| `kibi_impact_override_missing_rationale` | A `Kibi-Impact: none` declaration has no `Rationale:` line. | Add the rationale, or drop the declaration and stage real evidence. |
|
|
32
|
+
| `entity-context-missing` (staged entity) | A staged requirement, scenario, test, ADR or observation fact has fewer than 12 words of context. | Upsert a sectioned `document.body` (see `kibi-usage`, Entity body contract). |
|
|
33
|
+
| `domain-contradictions`, `scenario-feasibility`, `exception-claim-keys` (staged `.kb/` change) | The staged knowledge introduces a violation the last commit did not have. | Fix the knowledge; a contradiction with a recorded rule goes to the person (`kibi-decisions`). |
|
|
34
|
+
| Proposition-complete ingestion | A staged requirement's semantic inventory is missing or no longer matches its prose. | Re-derive it (`kb_model` analyze with the complete prose) or run `kibi migrate` for drift. |
|
|
35
|
+
| `kibi check-generated --staged` drift | The staged `.kb/symbols.yaml` or `.kb/symbol-coordinates.yaml` differs from a refresh computed from the index. | `kibi sync --refresh-symbol-coordinates`, review the diff, stage only the intended hunks (`git add -p`). |
|
|
36
|
+
| `Staged impact review failed: impact_review_invalid: ...` | The base commit has `.kibi/impact-policy.json` and the staged `.kibi/impact-review.json` is missing, stale or incomplete. The message names the cause (missing review path, stale fingerprint, ...). | Prepare a fresh record (below). Any later staged change makes the fingerprints stale again, so prepare it last. |
|
|
37
|
+
|
|
38
|
+
## Advisory findings
|
|
39
|
+
|
|
40
|
+
These warn but do not block. Read them; they are often the real review.
|
|
41
|
+
|
|
42
|
+
- `requirement_statement_unverified`: quotes each current requirement the
|
|
43
|
+
changed code implements, with its firmness. Compare the code with the
|
|
44
|
+
statement yourself.
|
|
45
|
+
- `symbol_semantic_review_needed`: the links exist, but check that the linked
|
|
46
|
+
requirement, scenario and test still describe the changed behavior. In a
|
|
47
|
+
file with no linked symbol it says no recorded intent covers the change.
|
|
48
|
+
- `staged_file_ownership_missing` / `staged_file_impact_review_needed`: a
|
|
49
|
+
staged text file (not TypeScript or JavaScript) has no owning requirement,
|
|
50
|
+
or has one and no matching evidence changed.
|
|
51
|
+
|
|
52
|
+
## Audited no-impact declaration
|
|
53
|
+
|
|
54
|
+
For a false positive or an edit that changes no behavior, Kibi accepts a
|
|
55
|
+
staged Markdown note in a knowledge lane under `.kb/` with the two lines
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
Kibi-Impact: none
|
|
59
|
+
Rationale: <why the staged source edits change no behavior>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
It never satisfies a genuine behavior change, and it is visible in review.
|
|
63
|
+
Prefer real evidence; use the note only when the person agrees the edit has
|
|
64
|
+
no behavior impact.
|
|
65
|
+
|
|
66
|
+
## Impact-review record
|
|
67
|
+
|
|
68
|
+
`kb_prepare_impact_review` (CLI `prepare-impact-review --input`) takes only
|
|
69
|
+
`scope`: `{"kind":"staged"}`, or
|
|
70
|
+
`{"kind":"diff","baseCommit":"<sha>","headCommit":"<sha>"}` with full
|
|
71
|
+
lowercase 40- or 64-hex commit ids. It returns `status: ready_for_authoring`,
|
|
72
|
+
the `snapshot` identity, `recordHeaders` (policy, evaluator and scope
|
|
73
|
+
fingerprints), complete per-file evidence in `files`, `requirementScopes`,
|
|
74
|
+
`residualReviewObligations`, and `authorship` with the record schemas and an
|
|
75
|
+
unauthored `recordTemplate`.
|
|
76
|
+
|
|
77
|
+
Fill only the authored fields (`files[].decision`, `files[].analysisReviews`,
|
|
78
|
+
`reviewer.id`, `reviewedAt`) and write the record to `.kibi/impact-review.json`,
|
|
79
|
+
then stage it. A file `decision` is one of:
|
|
80
|
+
|
|
81
|
+
- `{"kind":"impact","requirementIds":[...],"knowledge":{"state":"still_current","rationale":"..."}}`
|
|
82
|
+
- `{"kind":"impact","requirementIds":[...],"knowledge":{"state":"updated","entities":[{"entityId":"...","artifactPath":"...","beforeFingerprint":"<sha256 or null>","afterFingerprint":"<sha256>"}]}}`
|
|
83
|
+
- `{"kind":"no_impact","reason":"...","rationale":"..."}`
|
|
84
|
+
- `{"kind":"not_applicable","policyReason":"...","rationale":"..."}` (only
|
|
85
|
+
where the policy lists the path as not applicable)
|
|
86
|
+
|
|
87
|
+
`reviewer.source` is `self-claimed-local`: the record says who reviewed, it
|
|
88
|
+
does not prove it. Put the person's id there only when they reviewed it.
|
|
89
|
+
|
|
90
|
+
## Commands
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npx --no-install kibi check --staged # the gate
|
|
94
|
+
npx --no-install kibi check --staged --format json # with full evidence
|
|
95
|
+
npx --no-install kibi check-generated --staged # manifest drift
|
|
96
|
+
npx --no-install kibi sync --refresh-symbol-coordinates # refresh coordinates
|
|
97
|
+
git status --short .kb # what Kibi wrote
|
|
98
|
+
```
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: kibi-decisions
|
|
3
|
+
name: kibi-decisions
|
|
4
|
+
description: "Use when the person states a rule or decision (must, never, always, from now on, we decided), when a Kibi hook asks to confirm or warns about an edit to code that implements a firm requirement, when the Stop hook says source files changed but nothing was recorded, when kb_check quotes requirement_statement_unverified, or when a request conflicts with a recorded requirement or ADR. Covers reading firmness and origin, recording a person's rule as firm with origin.ref, superseding with a Why this changed section, the kb_compile_intent unresolved/reviewCandidates/conflictReviews loop, asking before overriding a firm rule, and putting decisions to the person as one numbered kibi signoff --questions view."
|
|
5
|
+
version: 1.2.0
|
|
6
|
+
kibiCompatibility: ">=1.0.0"
|
|
7
|
+
tags:
|
|
8
|
+
- kibi
|
|
9
|
+
- decisions
|
|
10
|
+
- firmness
|
|
11
|
+
- source-first
|
|
12
|
+
- agent-guidance
|
|
13
|
+
resources:
|
|
14
|
+
- resources/decision-records.md
|
|
15
|
+
- resources/signoff-views.md
|
|
16
|
+
---
|
|
17
|
+
## Goal
|
|
18
|
+
|
|
19
|
+
Keep the people's rules theirs. A recorded requirement or ADR says how firmly
|
|
20
|
+
it was decided; follow it, record new rules when they are stated, and put any
|
|
21
|
+
conflict with a rule to the person instead of coding around it.
|
|
22
|
+
|
|
23
|
+
## Interface Selection
|
|
24
|
+
|
|
25
|
+
Use the visible approved MCP tools or the trusted project-local CLI as equal
|
|
26
|
+
peer interfaces (CLI JSON: `printf '%s\n' '{"query":"..."}' | npx --no-install
|
|
27
|
+
kibi search --input -`). Exact routes are in
|
|
28
|
+
`kibi-usage/resources/operation-access.md`. If neither is available, stop and
|
|
29
|
+
name the missing capability. Never read or edit `.kb/` files directly.
|
|
30
|
+
|
|
31
|
+
## When this applies
|
|
32
|
+
|
|
33
|
+
- The person states a rule: "must", "never", "always", "from now on", "only
|
|
34
|
+
admins may", "we decided X because Y". The prompt hook may have noted it
|
|
35
|
+
("this request reads as a rule or decision").
|
|
36
|
+
- A hook says an edit changes code that implements a firm requirement: Claude
|
|
37
|
+
Code puts a permission prompt to the person; Codex, Cursor and ZCode tell
|
|
38
|
+
you to ask first unless the edit keeps the rule.
|
|
39
|
+
- The Stop hook says the session changed source files and recorded nothing.
|
|
40
|
+
- `kb_check` reports `requirement_statement_unverified`, quoting a requirement
|
|
41
|
+
the changed code implements, and the code no longer does what it says.
|
|
42
|
+
- A request contradicts a requirement or ADR you found.
|
|
43
|
+
|
|
44
|
+
## Read the rule first
|
|
45
|
+
|
|
46
|
+
1. `kb_search` the topic (or `sourceLocations` for the file you are changing),
|
|
47
|
+
then `kb_query({id})` each governing requirement or ADR. Add
|
|
48
|
+
`includeBody: true` to read its prose and context.
|
|
49
|
+
2. Read `firmness` (always shown, even when inferred) and `origin`:
|
|
50
|
+
- `firm`: a person set it. Follow it; changing it is the person's call.
|
|
51
|
+
A decision with no `firmness` reads as `firm` unless `origin.kind` is
|
|
52
|
+
`agent`.
|
|
53
|
+
- `default`: delegated or an agent's pick. Follow it; supersede it only on
|
|
54
|
+
evidence (a failing test, a measured cost, a constraint it missed).
|
|
55
|
+
- `exploratory`: a flagged guess; revisit it when you touch the area.
|
|
56
|
+
3. Compare the request with the statement. A request is not evidence against
|
|
57
|
+
a rule.
|
|
58
|
+
|
|
59
|
+
## Decide
|
|
60
|
+
|
|
61
|
+
- **Request conflicts with a recorded rule (any firmness):** name the rule (id
|
|
62
|
+
and what it requires) and ask whether to change it. Do not implement the
|
|
63
|
+
request and do not supersede the rule until the person says to change that
|
|
64
|
+
rule.
|
|
65
|
+
- **Edit confirmation declined, or nobody could answer:** the requirement
|
|
66
|
+
stands. Say which rule blocked it and ask how to proceed; never reach the
|
|
67
|
+
same change another way (another tool, a shell write, another file).
|
|
68
|
+
- **Edit confirmation allowed:** if the change still keeps the rule, carry on.
|
|
69
|
+
If it changes what the rule says, update the rule in this same change, citing
|
|
70
|
+
the person's words. Clicking allow is not a stated rule: when their request
|
|
71
|
+
did not state the new behavior, ask them to say it before rewriting the rule.
|
|
72
|
+
- **The person states a new rule:** record it with `kb_upsert` as part of the
|
|
73
|
+
change, not after: a requirement with `firmness: firm`, `origin.ref`
|
|
74
|
+
quoting their words and where they said them, a sectioned `document.body`,
|
|
75
|
+
a scenario, and an `implements` link from the code that enforces it. Use
|
|
76
|
+
`kb_compile_intent` first when the rule may touch several requirements.
|
|
77
|
+
- **The person changes a rule:** supersede it (new requirement linked
|
|
78
|
+
`supersedes` new -> old, `firmness: firm` when the old one was firm, a
|
|
79
|
+
`## Why this changed` section of at least 12 words naming their instruction
|
|
80
|
+
and answering the old reasoning, old one `status: closed` in the same
|
|
81
|
+
change). For a wording correction they asked for in place, update it with a
|
|
82
|
+
new `origin.ref` to those words instead.
|
|
83
|
+
- **You only prefer another approach:** a preference is not evidence. Propose
|
|
84
|
+
it; do not supersede.
|
|
85
|
+
|
|
86
|
+
## Put decisions to the person in one view
|
|
87
|
+
|
|
88
|
+
Whenever you ask the person to confirm rules (a stated rule to record as
|
|
89
|
+
firm, a change to a recorded rule, a conflict with one), render every open
|
|
90
|
+
question as one numbered view instead of scattering them through the chat:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
printf '%s\n' '{"questions":[{"title":"Refund approvals","statement":"Refunds above 500 EUR need a finance approval.","quote":"from now on refunds above 500 EUR must be approved by finance","firmness":"firm","governs":["src/refunds/approve.ts"],"question":"Record this as a firm rule?"}]}' | npx --no-install kibi signoff --questions -
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Put the printed Markdown in your reply unchanged (or, when your replies go
|
|
97
|
+
through a messaging tool, in that tool's message, with
|
|
98
|
+
`.kb/briefs/signoff/latest.html` attached or published when it can carry a
|
|
99
|
+
page), then wait. In the OpenCode terminal use `--format md` so the fenced
|
|
100
|
+
block renders as a card. Set `id` when a question would change a recorded
|
|
101
|
+
requirement and `conflictsWith` to the recorded rules it conflicts with: the
|
|
102
|
+
view quotes their current text from the knowledge base, so never retype it.
|
|
103
|
+
When the person answers by number, fill each question's `answer` and render
|
|
104
|
+
again until none is open, then record each rule with their words in
|
|
105
|
+
`origin.ref`. Fields and outputs: `resources/signoff-views.md`.
|
|
106
|
+
|
|
107
|
+
Never invent words for `origin.ref`, never set `approved_by` yourself, and
|
|
108
|
+
mark your own picks `default` and guesses `exploratory`. Payload shapes,
|
|
109
|
+
refusal messages and the `kb_compile_intent` review loop are in
|
|
110
|
+
`resources/decision-records.md`.
|
|
111
|
+
|
|
112
|
+
## Typed results
|
|
113
|
+
|
|
114
|
+
Parse `kibiProtocol`, `status`, diagnostics and typed `nextActions`. A
|
|
115
|
+
refused write (`Entity validation failed: <ID> is a firm decision ...`)
|
|
116
|
+
wrote nothing: do not retry it with the same payload; ask, then supersede or
|
|
117
|
+
cite new words. On `committed_with_repairs` the write stands: run the repair
|
|
118
|
+
actions and never resend the original. Kibi authors tracked files but never
|
|
119
|
+
Git-stages or commits them.
|
|
120
|
+
|
|
121
|
+
Validation is not completion. When a request conflicts with a recorded rule and you stop to ask, first kb_query that rule by id. Then make the conflict itself the verdict of your final answer: name the rule's id and what it requires, keep the answer format the request asked for (including any verdict field), and add your question after that. Asking the person, or showing a questions view, never takes the place of that verdict. When you record a stated rule or apply a kb_compile_intent plan, keep the actual target ids and the intended edges. Discover and kb_query each target, check each payload with kb_upsert and dryRun: true, then send that same payload as the real kb_upsert. Read the result back by exact id before kb_check. A dry run or kb_model output only validates; it records nothing. A stated rule is recorded only once the requirement, its scenario and the enforcing symbol's implements link have actually been written, followed by kb_check. Separate payloads may need several writes in sequence. Never resend a write that already committed, and handle refusals or repairs as the typed-result rules above say. After you apply a plan, make sure the new requirement is firm, with origin.ref quoting the person's words. A must-priority requirement also needs a scenario through specified_by. Leave compatible recorded rules unchanged. Rerun kb_check after each fix until it reports nothing about the new requirement, and only then report the work as done.
|
|
122
|
+
|
|
123
|
+
## Report
|
|
124
|
+
|
|
125
|
+
End with `kb_check` (and `kb_status` when freshness matters) and say:
|
|
126
|
+
|
|
127
|
+
- which rules you followed, asked about, recorded or changed (ids, firmness);
|
|
128
|
+
- under "Decisions I changed", each supersede and its evidence;
|
|
129
|
+
- the open question, if a conflict is waiting on the person;
|
|
130
|
+
- or, when the session made no decision, one line saying so.
|