@oscharko-dev/keiko-contracts 0.2.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/.tsbuildinfo +1 -0
- package/dist/bff-wire.d.ts +661 -0
- package/dist/bff-wire.d.ts.map +1 -0
- package/dist/bff-wire.js +102 -0
- package/dist/bug-investigation-events.d.ts +92 -0
- package/dist/bug-investigation-events.d.ts.map +1 -0
- package/dist/bug-investigation-events.js +18 -0
- package/dist/coding-context.d.ts +76 -0
- package/dist/coding-context.d.ts.map +1 -0
- package/dist/coding-context.js +158 -0
- package/dist/connected-context.d.ts +174 -0
- package/dist/connected-context.d.ts.map +1 -0
- package/dist/connected-context.js +636 -0
- package/dist/conversation-budget.d.ts +37 -0
- package/dist/conversation-budget.d.ts.map +1 -0
- package/dist/conversation-budget.js +97 -0
- package/dist/editor-agent.d.ts +131 -0
- package/dist/editor-agent.d.ts.map +1 -0
- package/dist/editor-agent.js +197 -0
- package/dist/editor-completion.d.ts +62 -0
- package/dist/editor-completion.d.ts.map +1 -0
- package/dist/editor-completion.js +147 -0
- package/dist/editor-dirty-close.d.ts +17 -0
- package/dist/editor-dirty-close.d.ts.map +1 -0
- package/dist/editor-dirty-close.js +8 -0
- package/dist/editor-hot-exit.d.ts +18 -0
- package/dist/editor-hot-exit.d.ts.map +1 -0
- package/dist/editor-hot-exit.js +42 -0
- package/dist/editor-inline-completion.d.ts +70 -0
- package/dist/editor-inline-completion.d.ts.map +1 -0
- package/dist/editor-inline-completion.js +215 -0
- package/dist/editor-layout.d.ts +105 -0
- package/dist/editor-layout.d.ts.map +1 -0
- package/dist/editor-layout.js +479 -0
- package/dist/editor-patch-apply.d.ts +77 -0
- package/dist/editor-patch-apply.d.ts.map +1 -0
- package/dist/editor-patch-apply.js +122 -0
- package/dist/editor-session.d.ts +31 -0
- package/dist/editor-session.d.ts.map +1 -0
- package/dist/editor-session.js +75 -0
- package/dist/editor-test-generation.d.ts +104 -0
- package/dist/editor-test-generation.d.ts.map +1 -0
- package/dist/editor-test-generation.js +211 -0
- package/dist/evaluations.d.ts +75 -0
- package/dist/evaluations.d.ts.map +1 -0
- package/dist/evaluations.js +16 -0
- package/dist/evidence.d.ts +297 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +9 -0
- package/dist/gateway.d.ts +129 -0
- package/dist/gateway.d.ts.map +1 -0
- package/dist/gateway.js +66 -0
- package/dist/harness.d.ts +274 -0
- package/dist/harness.d.ts.map +1 -0
- package/dist/harness.js +38 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +83 -0
- package/dist/language-service.d.ts +145 -0
- package/dist/language-service.d.ts.map +1 -0
- package/dist/language-service.js +161 -0
- package/dist/local-knowledge-large-document-validation.d.ts +7 -0
- package/dist/local-knowledge-large-document-validation.d.ts.map +1 -0
- package/dist/local-knowledge-large-document-validation.js +161 -0
- package/dist/local-knowledge-large-document.d.ts +113 -0
- package/dist/local-knowledge-large-document.d.ts.map +1 -0
- package/dist/local-knowledge-large-document.js +142 -0
- package/dist/local-knowledge-paths.d.ts +3 -0
- package/dist/local-knowledge-paths.d.ts.map +1 -0
- package/dist/local-knowledge-paths.js +65 -0
- package/dist/local-knowledge-records.d.ts +190 -0
- package/dist/local-knowledge-records.d.ts.map +1 -0
- package/dist/local-knowledge-records.js +36 -0
- package/dist/local-knowledge-schema-validation.d.ts +19 -0
- package/dist/local-knowledge-schema-validation.d.ts.map +1 -0
- package/dist/local-knowledge-schema-validation.js +115 -0
- package/dist/local-knowledge-schema.d.ts +14 -0
- package/dist/local-knowledge-schema.d.ts.map +1 -0
- package/dist/local-knowledge-schema.js +715 -0
- package/dist/local-knowledge-validation.d.ts +20 -0
- package/dist/local-knowledge-validation.d.ts.map +1 -0
- package/dist/local-knowledge-validation.js +487 -0
- package/dist/local-knowledge.d.ts +158 -0
- package/dist/local-knowledge.d.ts.map +1 -0
- package/dist/local-knowledge.js +63 -0
- package/dist/memory-audit-events.d.ts +73 -0
- package/dist/memory-audit-events.d.ts.map +1 -0
- package/dist/memory-audit-events.js +44 -0
- package/dist/memory-audit-validation.d.ts +4 -0
- package/dist/memory-audit-validation.d.ts.map +1 -0
- package/dist/memory-audit-validation.js +151 -0
- package/dist/memory-barrel.d.ts +15 -0
- package/dist/memory-barrel.d.ts.map +1 -0
- package/dist/memory-barrel.js +20 -0
- package/dist/memory-internal.d.ts +26 -0
- package/dist/memory-internal.d.ts.map +1 -0
- package/dist/memory-internal.js +104 -0
- package/dist/memory-operations-validation.d.ts +12 -0
- package/dist/memory-operations-validation.d.ts.map +1 -0
- package/dist/memory-operations-validation.js +267 -0
- package/dist/memory-operations.d.ts +156 -0
- package/dist/memory-operations.d.ts.map +1 -0
- package/dist/memory-operations.js +29 -0
- package/dist/memory-record-validation.d.ts +10 -0
- package/dist/memory-record-validation.d.ts.map +1 -0
- package/dist/memory-record-validation.js +101 -0
- package/dist/memory-records.d.ts +66 -0
- package/dist/memory-records.d.ts.map +1 -0
- package/dist/memory-records.js +22 -0
- package/dist/memory-retrieval-validation.d.ts +6 -0
- package/dist/memory-retrieval-validation.d.ts.map +1 -0
- package/dist/memory-retrieval-validation.js +108 -0
- package/dist/memory-validation.d.ts +31 -0
- package/dist/memory-validation.d.ts.map +1 -0
- package/dist/memory-validation.js +318 -0
- package/dist/memory-workflow-port.d.ts +26 -0
- package/dist/memory-workflow-port.d.ts.map +1 -0
- package/dist/memory-workflow-port.js +13 -0
- package/dist/memory.d.ts +81 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +104 -0
- package/dist/prompt-enhancer-analyzer.d.ts +7 -0
- package/dist/prompt-enhancer-analyzer.d.ts.map +1 -0
- package/dist/prompt-enhancer-analyzer.js +745 -0
- package/dist/prompt-enhancer-bff.d.ts +67 -0
- package/dist/prompt-enhancer-bff.d.ts.map +1 -0
- package/dist/prompt-enhancer-bff.js +156 -0
- package/dist/prompt-enhancer-critic.d.ts +46 -0
- package/dist/prompt-enhancer-critic.d.ts.map +1 -0
- package/dist/prompt-enhancer-critic.js +35 -0
- package/dist/prompt-enhancer-grounding.d.ts +19 -0
- package/dist/prompt-enhancer-grounding.d.ts.map +1 -0
- package/dist/prompt-enhancer-grounding.js +235 -0
- package/dist/prompt-enhancer-safety.d.ts +66 -0
- package/dist/prompt-enhancer-safety.d.ts.map +1 -0
- package/dist/prompt-enhancer-safety.js +446 -0
- package/dist/prompt-enhancer-validation.d.ts +28 -0
- package/dist/prompt-enhancer-validation.d.ts.map +1 -0
- package/dist/prompt-enhancer-validation.js +931 -0
- package/dist/prompt-enhancer.d.ts +184 -0
- package/dist/prompt-enhancer.d.ts.map +1 -0
- package/dist/prompt-enhancer.js +350 -0
- package/dist/qualityIntelligence/assertNever.d.ts +2 -0
- package/dist/qualityIntelligence/assertNever.d.ts.map +1 -0
- package/dist/qualityIntelligence/assertNever.js +7 -0
- package/dist/qualityIntelligence/auditSummary.d.ts +25 -0
- package/dist/qualityIntelligence/auditSummary.d.ts.map +1 -0
- package/dist/qualityIntelligence/auditSummary.js +7 -0
- package/dist/qualityIntelligence/bffWire.d.ts +356 -0
- package/dist/qualityIntelligence/bffWire.d.ts.map +1 -0
- package/dist/qualityIntelligence/bffWire.js +22 -0
- package/dist/qualityIntelligence/coverageMap.d.ts +21 -0
- package/dist/qualityIntelligence/coverageMap.d.ts.map +1 -0
- package/dist/qualityIntelligence/coverageMap.js +29 -0
- package/dist/qualityIntelligence/editableRevision.d.ts +21 -0
- package/dist/qualityIntelligence/editableRevision.d.ts.map +1 -0
- package/dist/qualityIntelligence/editableRevision.js +8 -0
- package/dist/qualityIntelligence/evidenceAtom.d.ts +35 -0
- package/dist/qualityIntelligence/evidenceAtom.d.ts.map +1 -0
- package/dist/qualityIntelligence/evidenceAtom.js +29 -0
- package/dist/qualityIntelligence/exportBundle.d.ts +28 -0
- package/dist/qualityIntelligence/exportBundle.d.ts.map +1 -0
- package/dist/qualityIntelligence/exportBundle.js +46 -0
- package/dist/qualityIntelligence/handoffEnvelope.d.ts +23 -0
- package/dist/qualityIntelligence/handoffEnvelope.d.ts.map +1 -0
- package/dist/qualityIntelligence/handoffEnvelope.js +8 -0
- package/dist/qualityIntelligence/ids.d.ts +58 -0
- package/dist/qualityIntelligence/ids.d.ts.map +1 -0
- package/dist/qualityIntelligence/ids.js +93 -0
- package/dist/qualityIntelligence/index.d.ts +29 -0
- package/dist/qualityIntelligence/index.d.ts.map +1 -0
- package/dist/qualityIntelligence/index.js +20 -0
- package/dist/qualityIntelligence/reviewRecord.d.ts +19 -0
- package/dist/qualityIntelligence/reviewRecord.d.ts.map +1 -0
- package/dist/qualityIntelligence/reviewRecord.js +20 -0
- package/dist/qualityIntelligence/runPlanAndEvents.d.ts +84 -0
- package/dist/qualityIntelligence/runPlanAndEvents.d.ts.map +1 -0
- package/dist/qualityIntelligence/runPlanAndEvents.js +51 -0
- package/dist/qualityIntelligence/sourceEnvelope.d.ts +77 -0
- package/dist/qualityIntelligence/sourceEnvelope.d.ts.map +1 -0
- package/dist/qualityIntelligence/sourceEnvelope.js +118 -0
- package/dist/qualityIntelligence/testCaseCandidate.d.ts +21 -0
- package/dist/qualityIntelligence/testCaseCandidate.d.ts.map +1 -0
- package/dist/qualityIntelligence/testCaseCandidate.js +21 -0
- package/dist/qualityIntelligence/testQualityRubric.d.ts +17 -0
- package/dist/qualityIntelligence/testQualityRubric.d.ts.map +1 -0
- package/dist/qualityIntelligence/testQualityRubric.js +32 -0
- package/dist/qualityIntelligence/validationFinding.d.ts +48 -0
- package/dist/qualityIntelligence/validationFinding.d.ts.map +1 -0
- package/dist/qualityIntelligence/validationFinding.js +36 -0
- package/dist/relationships-validation.d.ts +13 -0
- package/dist/relationships-validation.d.ts.map +1 -0
- package/dist/relationships-validation.js +422 -0
- package/dist/relationships.d.ts +79 -0
- package/dist/relationships.d.ts.map +1 -0
- package/dist/relationships.js +307 -0
- package/dist/text-safety.d.ts +7 -0
- package/dist/text-safety.d.ts.map +1 -0
- package/dist/text-safety.js +58 -0
- package/dist/tools.d.ts +153 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +118 -0
- package/dist/unit-test-events.d.ts +87 -0
- package/dist/unit-test-events.d.ts.map +1 -0
- package/dist/unit-test-events.js +14 -0
- package/dist/verification-summary.d.ts +38 -0
- package/dist/verification-summary.d.ts.map +1 -0
- package/dist/verification-summary.js +5 -0
- package/dist/verification.d.ts +64 -0
- package/dist/verification.d.ts.map +1 -0
- package/dist/verification.js +13 -0
- package/dist/workflow-descriptor.d.ts +21 -0
- package/dist/workflow-descriptor.d.ts.map +1 -0
- package/dist/workflow-descriptor.js +8 -0
- package/dist/workflow-handoff.d.ts +69 -0
- package/dist/workflow-handoff.d.ts.map +1 -0
- package/dist/workflow-handoff.js +381 -0
- package/dist/workspace-descriptors.d.ts +21 -0
- package/dist/workspace-descriptors.d.ts.map +1 -0
- package/dist/workspace-descriptors.js +180 -0
- package/dist/workspace-ui.d.ts +119 -0
- package/dist/workspace-ui.d.ts.map +1 -0
- package/dist/workspace-ui.js +105 -0
- package/dist/workspace.d.ts +104 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +27 -0
- package/package.json +71 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import type { QualityIntelligenceValidationFindingKind } from "./validationFinding.js";
|
|
2
|
+
import type { QualityIntelligenceSeverity } from "./validationFinding.js";
|
|
3
|
+
import type { QualityIntelligencePriority, QualityIntelligenceRiskClass, QualityIntelligenceTestCaseStatus } from "./testCaseCandidate.js";
|
|
4
|
+
import type { QualityIntelligenceReviewState } from "./reviewRecord.js";
|
|
5
|
+
import type { TestQualityRubricDimension } from "./testQualityRubric.js";
|
|
6
|
+
/** Counts-only totals carried on both the list-view and the detail view. */
|
|
7
|
+
export interface QualityIntelligenceUiRunTotals {
|
|
8
|
+
readonly candidates: number;
|
|
9
|
+
readonly findings: number;
|
|
10
|
+
readonly exports: number;
|
|
11
|
+
}
|
|
12
|
+
/** List-view projection — only what the run list needs. */
|
|
13
|
+
export interface QualityIntelligenceUiRunSummary {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly status: "running" | "succeeded" | "failed" | "cancelled";
|
|
16
|
+
/** ISO 8601 timestamp. */
|
|
17
|
+
readonly requestedAt: string;
|
|
18
|
+
/** ISO 8601 timestamp, or null when the run has not yet completed. */
|
|
19
|
+
readonly completedAt: string | null;
|
|
20
|
+
readonly totals: QualityIntelligenceUiRunTotals;
|
|
21
|
+
/** Overall human-review state for the run (Issue #282); "open" until a reviewer acts. */
|
|
22
|
+
readonly reviewState: QualityIntelligenceReviewState;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Response envelope for `GET /api/quality-intelligence/runs` (issue #646).
|
|
26
|
+
*
|
|
27
|
+
* The list route bounds manifest loading by a default limit and reports how many run ids the
|
|
28
|
+
* underlying store knows about so the UI can render a "more available" indicator without doing
|
|
29
|
+
* a second pass. Producers MUST cap the `runs` array at `limit` and set `truncated = true` when
|
|
30
|
+
* `totalRunIds > limit`. Additive on the wire: legacy clients reading `runs` continue to work.
|
|
31
|
+
*/
|
|
32
|
+
export interface QualityIntelligenceUiRunListResponse {
|
|
33
|
+
readonly runs: readonly QualityIntelligenceUiRunSummary[];
|
|
34
|
+
/** Effective limit applied for this response (default or explicit, capped at the route max). */
|
|
35
|
+
readonly limit: number;
|
|
36
|
+
/** Total run ids the store reported (may exceed runs.length when truncated). */
|
|
37
|
+
readonly totalRunIds: number;
|
|
38
|
+
/** True when totalRunIds > limit; the response omits the tail of the run list. */
|
|
39
|
+
readonly truncated: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Per-finding row for the findings panel.
|
|
43
|
+
* `summaryRedacted` is a non-secret single-sentence description already passed through
|
|
44
|
+
* the QI redaction pipeline. Producers MUST NOT send raw validator output here.
|
|
45
|
+
*/
|
|
46
|
+
export interface QualityIntelligenceUiFindingSummary {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly kind: QualityIntelligenceValidationFindingKind;
|
|
49
|
+
readonly severity: QualityIntelligenceSeverity;
|
|
50
|
+
/** Already redacted by the QI redaction pipeline before reaching the BFF. */
|
|
51
|
+
readonly summaryRedacted: string;
|
|
52
|
+
}
|
|
53
|
+
/** Evidence reference row — envelope id and atom id only, no content. */
|
|
54
|
+
export interface QualityIntelligenceUiEvidenceRef {
|
|
55
|
+
readonly envelopeId: string;
|
|
56
|
+
readonly atomId: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Per-atom coverage row for the UI. Refs plus an optional short REDACTED requirement excerpt
|
|
60
|
+
* (#790) so the Gap Radar can name the requirement, not just its opaque atom id. Never raw atom
|
|
61
|
+
* text — the excerpt is redacted+truncated at build time and redacted again at persist time.
|
|
62
|
+
* Absent on runs recorded before #790.
|
|
63
|
+
*/
|
|
64
|
+
export interface QualityIntelligenceUiAtomCoverage {
|
|
65
|
+
readonly atomId: string;
|
|
66
|
+
readonly status: "covered" | "weakly-covered" | "uncovered";
|
|
67
|
+
readonly confidence: number;
|
|
68
|
+
readonly requirementExcerptRedacted?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Weak-test flag surfaced when the adversarial test-quality judge (Epic #736) classified a
|
|
72
|
+
* candidate as weak. Carries only the redacted judge rationale and the finding severity — never
|
|
73
|
+
* raw model output. Absent on a candidate that the judge rated strong or that was never judged.
|
|
74
|
+
*/
|
|
75
|
+
export interface QualityIntelligenceUiWeakTestFlag {
|
|
76
|
+
readonly severity: QualityIntelligenceSeverity;
|
|
77
|
+
/** Single-sentence reason, already passed through the QI redaction pipeline. */
|
|
78
|
+
readonly rationale: string;
|
|
79
|
+
}
|
|
80
|
+
export interface QualityIntelligenceUiCandidateQualityVerdict {
|
|
81
|
+
readonly verdict: "strong" | "weak";
|
|
82
|
+
readonly score: number;
|
|
83
|
+
readonly dimensions: readonly TestQualityRubricDimension[];
|
|
84
|
+
readonly overallRationale: string;
|
|
85
|
+
}
|
|
86
|
+
export interface QualityIntelligenceUiDriftMetadata {
|
|
87
|
+
/**
|
|
88
|
+
* GET run detail is read-only: it reports whether drift tracking metadata exists, but never
|
|
89
|
+
* re-reads local sources. Clients call re-check with current source handles to compute staleness.
|
|
90
|
+
*/
|
|
91
|
+
readonly status: "not-checked" | "unavailable";
|
|
92
|
+
/** Count only; raw fingerprint hashes stay in evidence and are never sent to the browser. */
|
|
93
|
+
readonly sourceFingerprintCount: number;
|
|
94
|
+
/** Count only; raw atom hashes stay in evidence and are never sent to the browser. */
|
|
95
|
+
readonly atomFingerprintCount: number;
|
|
96
|
+
readonly reCheckSupported: boolean;
|
|
97
|
+
readonly regenerateStaleSupported: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Single-run detail projection.
|
|
101
|
+
* Adds full finding rows, candidate id refs, evidence refs, and the manifest schema
|
|
102
|
+
* version. Never carries raw prompts, model output, credentials, or provider URLs.
|
|
103
|
+
*/
|
|
104
|
+
export interface QualityIntelligenceUiRunDetail {
|
|
105
|
+
readonly id: string;
|
|
106
|
+
readonly status: "running" | "succeeded" | "failed" | "cancelled";
|
|
107
|
+
/** ISO 8601 timestamp. */
|
|
108
|
+
readonly requestedAt: string;
|
|
109
|
+
/** ISO 8601 timestamp, or null when the run has not yet completed. */
|
|
110
|
+
readonly completedAt: string | null;
|
|
111
|
+
readonly totals: QualityIntelligenceUiRunTotals;
|
|
112
|
+
readonly findingRefs: readonly QualityIntelligenceUiFindingSummary[];
|
|
113
|
+
readonly candidateIds: readonly string[];
|
|
114
|
+
/**
|
|
115
|
+
* Browser-safe projection of the generated test-case bodies (Issue #280). Empty when the run
|
|
116
|
+
* produced no candidate artifact (e.g. a failed run or a legacy run recorded before candidate
|
|
117
|
+
* persistence). Bodies are redacted by the producer before reaching this wire shape.
|
|
118
|
+
*/
|
|
119
|
+
readonly candidates: readonly QualityIntelligenceUiCandidate[];
|
|
120
|
+
readonly evidenceRefs: readonly QualityIntelligenceUiEvidenceRef[];
|
|
121
|
+
/** Overall human-review state for the run (Issue #282); "open" until a reviewer acts. */
|
|
122
|
+
readonly reviewState: QualityIntelligenceReviewState;
|
|
123
|
+
/** The `qiEvidenceSchemaVersion` literal from the persisted manifest. */
|
|
124
|
+
readonly manifestSchemaVersion: number;
|
|
125
|
+
/** Coverage percentage: (covered atoms / total atoms) × 100. 0 when no matrix is available. */
|
|
126
|
+
readonly coveragePercentage: number;
|
|
127
|
+
/** Per-atom coverage classification (refs + status; empty when no matrix is available). */
|
|
128
|
+
readonly coverageByAtom: readonly QualityIntelligenceUiAtomCoverage[];
|
|
129
|
+
/**
|
|
130
|
+
* Run quality score: the percentage of candidates with a strong adversarial judge outcome [0-100]
|
|
131
|
+
* (Epic #736) — 100 = every judged test is strong, 0 = every judged test is weak. Null when the
|
|
132
|
+
* judge stage was skipped, unavailable, or there were no candidates to judge.
|
|
133
|
+
*/
|
|
134
|
+
readonly qualityScore: number | null;
|
|
135
|
+
/** Browser-safe Living Tests drift metadata; never contains raw source text, paths, or hashes. */
|
|
136
|
+
readonly drift: QualityIntelligenceUiDriftMetadata;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Browser-safe projection of a single generated test-case candidate (Issue #280/#282). Carries the
|
|
140
|
+
* authored body for review + export. Never carries the raw model prompt or raw source content; the
|
|
141
|
+
* producer redacts every string before constructing this shape.
|
|
142
|
+
*/
|
|
143
|
+
export interface QualityIntelligenceUiCandidate {
|
|
144
|
+
readonly id: string;
|
|
145
|
+
readonly title: string;
|
|
146
|
+
readonly preconditions: readonly string[];
|
|
147
|
+
readonly steps: readonly string[];
|
|
148
|
+
readonly expectedResults: readonly string[];
|
|
149
|
+
readonly priority: QualityIntelligencePriority;
|
|
150
|
+
readonly riskClass: QualityIntelligenceRiskClass;
|
|
151
|
+
readonly tags: readonly string[];
|
|
152
|
+
/** Generation status from the candidate body. */
|
|
153
|
+
readonly status: QualityIntelligenceTestCaseStatus;
|
|
154
|
+
/** Per-candidate review decision (Issue #282); "open" until a reviewer acts. */
|
|
155
|
+
readonly reviewState: QualityIntelligenceReviewState;
|
|
156
|
+
readonly derivedFromAtomIds: readonly string[];
|
|
157
|
+
/**
|
|
158
|
+
* Present when the adversarial test-quality judge evaluated this candidate. Additive and absent
|
|
159
|
+
* on legacy runs or when the judge stage was skipped.
|
|
160
|
+
*/
|
|
161
|
+
readonly qualityVerdict?: QualityIntelligenceUiCandidateQualityVerdict;
|
|
162
|
+
/**
|
|
163
|
+
* Present only when the adversarial test-quality judge (Epic #736) flagged this candidate as
|
|
164
|
+
* weak. Omitted entirely when the candidate was rated strong or the judge stage was skipped.
|
|
165
|
+
*/
|
|
166
|
+
readonly weakTestFlag?: QualityIntelligenceUiWeakTestFlag;
|
|
167
|
+
/**
|
|
168
|
+
* Candidate body fields shortened only for the browser-facing BFF projection. Persisted evidence
|
|
169
|
+
* and export semantics remain full-fidelity.
|
|
170
|
+
*/
|
|
171
|
+
readonly truncatedFields?: readonly ("title" | "preconditions" | "steps" | "expectedResults" | "tags")[];
|
|
172
|
+
}
|
|
173
|
+
/** Why a single candidate is stale: its source changed, or its source is gone. */
|
|
174
|
+
export interface QualityIntelligenceUiStalenessEntry {
|
|
175
|
+
readonly candidateId: string;
|
|
176
|
+
readonly reason: "source-changed" | "source-removed";
|
|
177
|
+
readonly envelopeId: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Response of `POST /api/quality-intelligence/runs/:id/re-check`. Reports which generated tests
|
|
181
|
+
* are still fresh and which drifted because their source fingerprint changed (or vanished) since
|
|
182
|
+
* the run was recorded. Refs only — no raw source text.
|
|
183
|
+
*/
|
|
184
|
+
export interface QualityIntelligenceUiStalenessReport {
|
|
185
|
+
readonly runId: string;
|
|
186
|
+
/** changedStale.length + orphanedStale.length. */
|
|
187
|
+
readonly staleCount: number;
|
|
188
|
+
readonly fresh: readonly string[];
|
|
189
|
+
readonly changedStale: readonly QualityIntelligenceUiStalenessEntry[];
|
|
190
|
+
readonly orphanedStale: readonly QualityIntelligenceUiStalenessEntry[];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Response of `POST /api/quality-intelligence/runs/:id/regenerate-stale`. Targeted regeneration
|
|
194
|
+
* writes a NEW immutable run; `runId` is that new run's id. Fresh candidates + human edits are
|
|
195
|
+
* preserved (`preservedCount`); only the stale subset is regenerated (`regeneratedCount`).
|
|
196
|
+
*/
|
|
197
|
+
export interface QualityIntelligenceUiRegenerateResult {
|
|
198
|
+
readonly runId: string;
|
|
199
|
+
readonly regeneratedCount: number;
|
|
200
|
+
readonly preservedCount: number;
|
|
201
|
+
}
|
|
202
|
+
export type QualityIntelligenceInlineSourceKind = "requirements" | "workspace" | "file" | "capsule" | "capsule-set" | "figma-snapshot" | "image";
|
|
203
|
+
/** A pasted free-text requirement blob the server splits into requirement atoms. */
|
|
204
|
+
export interface QualityIntelligenceRequirementsSource {
|
|
205
|
+
readonly kind: "requirements";
|
|
206
|
+
readonly label: string;
|
|
207
|
+
readonly text: string;
|
|
208
|
+
}
|
|
209
|
+
/** A local workspace folder the server ingests through keiko-workspace (path containment applies). */
|
|
210
|
+
export interface QualityIntelligenceWorkspaceSource {
|
|
211
|
+
readonly kind: "workspace";
|
|
212
|
+
readonly label: string;
|
|
213
|
+
readonly path: string;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* A single local file — one Fachkonzept document (Markdown / plain text / source file) the server
|
|
217
|
+
* ingests through keiko-workspace as exactly one source atom. The same path containment, deny
|
|
218
|
+
* rules, size cap, and redaction that protect the folder path apply identically here; binary or
|
|
219
|
+
* unsupported files are rejected with a coded, user-actionable error rather than partially
|
|
220
|
+
* ingested. `path` is an absolute local path resolved server-side (Epic #709, Issue #713).
|
|
221
|
+
*/
|
|
222
|
+
export interface QualityIntelligenceFileSource {
|
|
223
|
+
readonly kind: "file";
|
|
224
|
+
readonly label: string;
|
|
225
|
+
readonly path: string;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* A Local Knowledge capsule — an indexed knowledge capsule the server ingests by reading its full
|
|
229
|
+
* document corpus through keiko-local-knowledge. The capsuleId must match an existing indexed
|
|
230
|
+
* capsule; if the capsule is unavailable the server responds with QI_CAPSULE_UNAVAILABLE (Epic
|
|
231
|
+
* #710, Issue #717).
|
|
232
|
+
*/
|
|
233
|
+
export interface QualityIntelligenceCapsuleSource {
|
|
234
|
+
readonly kind: "capsule";
|
|
235
|
+
readonly label: string;
|
|
236
|
+
readonly capsuleId: string;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* A Local Knowledge capsule-SET — a named composition of capsules the server expands into its
|
|
240
|
+
* member capsules and ingests as one combined corpus. The capsuleSetId must match an existing
|
|
241
|
+
* capsule-set; an unknown or empty set is rejected with QI_CAPSULE_UNAVAILABLE (Epic #710,
|
|
242
|
+
* Issue #716/#717). The contract mirrors the single-capsule source so the connector picker can bind
|
|
243
|
+
* either a capsule or a capsule-set to the QI hub (Issue #718).
|
|
244
|
+
*/
|
|
245
|
+
export interface QualityIntelligenceCapsuleSetSource {
|
|
246
|
+
readonly kind: "capsule-set";
|
|
247
|
+
readonly label: string;
|
|
248
|
+
readonly capsuleSetId: string;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* A stored Figma Snapshot (Epic #750, Issue #753/#754) the server ingests by loading the immutable
|
|
252
|
+
* snapshot evidence record for `snapshotRunId` and deriving a deterministic, citation-ready
|
|
253
|
+
* structural test baseline per screen from its Screen-IR (fields/controls/screens/states), enriched
|
|
254
|
+
* by capability-routed vision only when a multimodal model is available. This source never contacts
|
|
255
|
+
* Figma — it reads ONLY the previously built snapshot. An unknown / unreadable snapshot is rejected
|
|
256
|
+
* with QI_FIGMA_SNAPSHOT_UNAVAILABLE. `screenIds`, when present, scopes ingestion to one or more
|
|
257
|
+
* specific masks from the snapshot so large boards do not flood QI with unrelated screens. The
|
|
258
|
+
* contract mirrors the capsule source so the connector picker can bind a snapshot to the QI hub.
|
|
259
|
+
*/
|
|
260
|
+
export interface QualityIntelligenceFigmaSnapshotSource {
|
|
261
|
+
readonly kind: "figma-snapshot";
|
|
262
|
+
readonly label: string;
|
|
263
|
+
readonly snapshotRunId: string;
|
|
264
|
+
/** Optional Screen-IR ids to ingest from the stored snapshot; absent means whole snapshot. */
|
|
265
|
+
readonly screenIds?: readonly string[];
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* A connected image source. The current producer is a stored Figma Snapshot screen render, but the
|
|
269
|
+
* source kind is intentionally generic: QI consumes it by generating a model-derived textual image
|
|
270
|
+
* description through an image-input-capable model, then treating that description as evidence.
|
|
271
|
+
* When no image-capable model is configured the source is rejected/skipped with a user-actionable
|
|
272
|
+
* code instead of pretending the image was understood.
|
|
273
|
+
*/
|
|
274
|
+
export interface QualityIntelligenceImageSource {
|
|
275
|
+
readonly kind: "image";
|
|
276
|
+
readonly label: string;
|
|
277
|
+
readonly sourceKind: "figma-snapshot-screen";
|
|
278
|
+
readonly snapshotRunId: string;
|
|
279
|
+
readonly screenId: string;
|
|
280
|
+
}
|
|
281
|
+
export type QualityIntelligenceInlineSource = QualityIntelligenceRequirementsSource | QualityIntelligenceWorkspaceSource | QualityIntelligenceFileSource | QualityIntelligenceCapsuleSource | QualityIntelligenceCapsuleSetSource | QualityIntelligenceFigmaSnapshotSource | QualityIntelligenceImageSource;
|
|
282
|
+
/** Body of `POST /api/quality-intelligence/runs`. */
|
|
283
|
+
export interface QualityIntelligenceStartRunRequest {
|
|
284
|
+
readonly sources: readonly QualityIntelligenceInlineSource[];
|
|
285
|
+
/** Policy profile id; defaults to the regression profile when omitted. */
|
|
286
|
+
readonly profileId?: string;
|
|
287
|
+
/** Preferred chat model id; the server may degrade to another compatible chat model or baseline. */
|
|
288
|
+
readonly modelId?: string;
|
|
289
|
+
/** Optional non-negative deterministic sampling seed for models that advertise seed support. */
|
|
290
|
+
readonly seed?: number;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* A connected source that ingested to nothing usable (empty / denied / binary / unavailable capsule)
|
|
294
|
+
* and was skipped so the remaining sources still produced the run (Epic #729 N+1 resilience). Carries
|
|
295
|
+
* only a sanitised label, the source kind, and a safe coded reason — never source content.
|
|
296
|
+
*/
|
|
297
|
+
export interface QualityIntelligenceSkippedSource {
|
|
298
|
+
readonly label: string;
|
|
299
|
+
readonly kind: string;
|
|
300
|
+
readonly code: string;
|
|
301
|
+
}
|
|
302
|
+
export interface QualityIntelligenceRunStreamAccepted {
|
|
303
|
+
readonly type: "accepted";
|
|
304
|
+
readonly runId: string;
|
|
305
|
+
readonly requestedAt: string;
|
|
306
|
+
readonly sourceCount: number;
|
|
307
|
+
readonly atomCount: number;
|
|
308
|
+
/**
|
|
309
|
+
* Sources dropped because the request exceeded the 16-source cap (Epic #729). Present and > 0 only
|
|
310
|
+
* when sources were dropped; the UI surfaces a coverage notice. Additive on the wire.
|
|
311
|
+
*/
|
|
312
|
+
readonly droppedSourceCount?: number;
|
|
313
|
+
/**
|
|
314
|
+
* Connected sources skipped because they ingested to nothing usable, while the healthy sources
|
|
315
|
+
* still produced the run (Epic #729 N+1 resilience). Present and non-empty only when a source was
|
|
316
|
+
* skipped; the UI surfaces a per-source coverage notice. Additive on the wire.
|
|
317
|
+
*/
|
|
318
|
+
readonly skippedSources?: readonly QualityIntelligenceSkippedSource[];
|
|
319
|
+
}
|
|
320
|
+
export interface QualityIntelligenceRunStreamEvent {
|
|
321
|
+
readonly type: "event";
|
|
322
|
+
readonly kind: string;
|
|
323
|
+
readonly sequence: number;
|
|
324
|
+
readonly stageName?: string;
|
|
325
|
+
readonly candidateId?: string;
|
|
326
|
+
readonly findingId?: string;
|
|
327
|
+
readonly reasonSummary?: string;
|
|
328
|
+
}
|
|
329
|
+
export interface QualityIntelligenceRunStreamDone {
|
|
330
|
+
readonly type: "done";
|
|
331
|
+
readonly runId: string;
|
|
332
|
+
readonly status: "succeeded" | "failed" | "cancelled";
|
|
333
|
+
readonly totals: QualityIntelligenceUiRunTotals;
|
|
334
|
+
/**
|
|
335
|
+
* Redaction-safe reason for terminal failed runs AND for succeeded-but-degraded runs (see
|
|
336
|
+
* `degraded`). This mirrors the bounded reasonSummary emitted by stage/run failure events so
|
|
337
|
+
* clients that only inspect the terminal frame can still present an actionable message without
|
|
338
|
+
* exposing provider details.
|
|
339
|
+
*/
|
|
340
|
+
readonly reasonSummary?: string;
|
|
341
|
+
/**
|
|
342
|
+
* True when the run completed (status "succeeded") but model generation/judging fell back to the
|
|
343
|
+
* deterministic baseline because the provider or parser failed. The run still produced usable
|
|
344
|
+
* baseline test cases, but the model output is absent — clients MUST surface this so a degraded
|
|
345
|
+
* run is never presented as an authoritative model-backed result (regulated-delivery audit). The
|
|
346
|
+
* redacted cause is carried in `reasonSummary`. Additive on the wire.
|
|
347
|
+
*/
|
|
348
|
+
readonly degraded?: boolean;
|
|
349
|
+
}
|
|
350
|
+
export interface QualityIntelligenceRunStreamError {
|
|
351
|
+
readonly type: "error";
|
|
352
|
+
readonly code: string;
|
|
353
|
+
readonly message: string;
|
|
354
|
+
}
|
|
355
|
+
export type QualityIntelligenceRunStreamMessage = QualityIntelligenceRunStreamAccepted | QualityIntelligenceRunStreamEvent | QualityIntelligenceRunStreamDone | QualityIntelligenceRunStreamError;
|
|
356
|
+
//# sourceMappingURL=bffWire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bffWire.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/bffWire.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EACV,2BAA2B,EAC3B,4BAA4B,EAC5B,iCAAiC,EAClC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,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ChD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,8BAA8B,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,mCAAmC,GAC3C,oCAAoC,GACpC,iCAAiC,GACjC,gCAAgC,GAChC,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Quality Intelligence BFF wire shapes (Issue #280, Epic #270).
|
|
2
|
+
//
|
|
3
|
+
// Browser-safe, redacted projections of QI evidence manifests for the Keiko UI.
|
|
4
|
+
// These types carry ONLY references and counts — never raw prompts, never raw source
|
|
5
|
+
// content, never credentials, endpoint URLs, or unsafe markdown. Producers must redact
|
|
6
|
+
// before constructing these shapes.
|
|
7
|
+
//
|
|
8
|
+
// Shape taxonomy:
|
|
9
|
+
// QualityIntelligenceUiRunSummary — list-view projection (id, status, dates, totals)
|
|
10
|
+
// QualityIntelligenceUiFindingSummary — per-finding row for the detail panel
|
|
11
|
+
// QualityIntelligenceUiEvidenceRef — evidence reference for the detail panel
|
|
12
|
+
// QualityIntelligenceUiRunDetail — single-run detail projection (adds finding refs,
|
|
13
|
+
// candidate ids, evidence refs, schema version, drift metadata)
|
|
14
|
+
//
|
|
15
|
+
// Invariants enforced by BFF producers:
|
|
16
|
+
// - No field that appears here derives from a raw prompt, API key, bearer token,
|
|
17
|
+
// or secret value.
|
|
18
|
+
// - `summaryRedacted` on finding rows has already been passed through the QI
|
|
19
|
+
// redaction pipeline before reaching this wire type.
|
|
20
|
+
// - completedAt is null (not undefined) when the run has not yet finished so JSON
|
|
21
|
+
// serialisation is deterministic.
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { QualityIntelligenceCoverageMapId, QualityIntelligenceEvidenceAtomId, QualityIntelligenceRunId, QualityIntelligenceTestCaseId } from "./ids.js";
|
|
2
|
+
export type QualityIntelligenceCoverageKind = "derived" | "asserted" | "manual";
|
|
3
|
+
export declare const QUALITY_INTELLIGENCE_COVERAGE_KINDS: readonly QualityIntelligenceCoverageKind[];
|
|
4
|
+
export interface QualityIntelligenceCoverageMapping {
|
|
5
|
+
readonly atomId: QualityIntelligenceEvidenceAtomId;
|
|
6
|
+
readonly candidateIds: readonly QualityIntelligenceTestCaseId[];
|
|
7
|
+
readonly coverageKind: QualityIntelligenceCoverageKind;
|
|
8
|
+
/** Confidence in `[0, 1]`. NaN, ±Infinity, and out-of-range values are rejected. */
|
|
9
|
+
readonly confidence: number;
|
|
10
|
+
}
|
|
11
|
+
export interface QualityIntelligenceCoverageMap {
|
|
12
|
+
readonly id: QualityIntelligenceCoverageMapId;
|
|
13
|
+
readonly runId: QualityIntelligenceRunId;
|
|
14
|
+
readonly mappings: readonly QualityIntelligenceCoverageMapping[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Throws `RangeError` on any out-of-range confidence (NaN, ±Infinity, < 0, > 1) and
|
|
18
|
+
* on a mapping with an empty `candidateIds` list. Returns `void` on success.
|
|
19
|
+
*/
|
|
20
|
+
export declare const assertCoverageMapInvariant: (map: QualityIntelligenceCoverageMap) => void;
|
|
21
|
+
//# sourceMappingURL=coverageMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverageMap.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/coverageMap.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,gCAAgC,EAChC,iCAAiC,EACjC,wBAAwB,EACxB,6BAA6B,EAC9B,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,+BAA+B,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEhF,eAAO,MAAM,mCAAmC,EAAE,SAAS,+BAA+B,EAIhF,CAAC;AAEX,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,MAAM,EAAE,iCAAiC,CAAC;IACnD,QAAQ,CAAC,YAAY,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAChE,QAAQ,CAAC,YAAY,EAAE,+BAA+B,CAAC;IACvD,oFAAoF;IACpF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,EAAE,EAAE,gCAAgC,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,SAAS,kCAAkC,EAAE,CAAC;CAClE;AAKD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,KAAK,8BAA8B,KAAG,IAmBhF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Quality Intelligence coverage map (Epic #270, Issue #277).
|
|
2
|
+
//
|
|
3
|
+
// A coverage map relates evidence atoms to the test-case candidates derived from
|
|
4
|
+
// them, with a per-mapping confidence in the half-closed range [0, 1]. The runtime
|
|
5
|
+
// helper `assertCoverageMapInvariant` enforces the float bound. Pure; no IO.
|
|
6
|
+
export const QUALITY_INTELLIGENCE_COVERAGE_KINDS = [
|
|
7
|
+
"derived",
|
|
8
|
+
"asserted",
|
|
9
|
+
"manual",
|
|
10
|
+
];
|
|
11
|
+
const isValidConfidence = (value) => Number.isFinite(value) && value >= 0 && value <= 1;
|
|
12
|
+
/**
|
|
13
|
+
* Throws `RangeError` on any out-of-range confidence (NaN, ±Infinity, < 0, > 1) and
|
|
14
|
+
* on a mapping with an empty `candidateIds` list. Returns `void` on success.
|
|
15
|
+
*/
|
|
16
|
+
export const assertCoverageMapInvariant = (map) => {
|
|
17
|
+
for (let index = 0; index < map.mappings.length; index += 1) {
|
|
18
|
+
const mapping = map.mappings[index];
|
|
19
|
+
if (mapping === undefined) {
|
|
20
|
+
throw new RangeError(`Coverage map mapping[${String(index)}] is missing`);
|
|
21
|
+
}
|
|
22
|
+
if (!isValidConfidence(mapping.confidence)) {
|
|
23
|
+
throw new RangeError(`Coverage map mapping[${String(index)}] has out-of-range confidence ${String(mapping.confidence)}`);
|
|
24
|
+
}
|
|
25
|
+
if (mapping.candidateIds.length === 0) {
|
|
26
|
+
throw new RangeError(`Coverage map mapping[${String(index)}] must reference at least one candidate`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { QualityIntelligencePriority, QualityIntelligenceRiskClass } from "./testCaseCandidate.js";
|
|
2
|
+
export interface QualityIntelligenceCandidateEditProvenance {
|
|
3
|
+
readonly editedAt: string;
|
|
4
|
+
readonly editedBy: "human" | "api";
|
|
5
|
+
readonly editorLabel: string;
|
|
6
|
+
}
|
|
7
|
+
export interface QualityIntelligenceCandidateEditableFields {
|
|
8
|
+
readonly title?: string;
|
|
9
|
+
readonly preconditions?: readonly string[];
|
|
10
|
+
readonly steps?: readonly string[];
|
|
11
|
+
readonly expectedResults?: readonly string[];
|
|
12
|
+
readonly priority?: QualityIntelligencePriority;
|
|
13
|
+
readonly riskClass?: QualityIntelligenceRiskClass;
|
|
14
|
+
readonly tags?: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
export interface QualityIntelligenceCandidateEditedRevision {
|
|
17
|
+
readonly candidateId: string;
|
|
18
|
+
readonly provenance: QualityIntelligenceCandidateEditProvenance;
|
|
19
|
+
readonly editedFields: QualityIntelligenceCandidateEditableFields;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=editableRevision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editableRevision.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/editableRevision.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,0CAA0C;IACzD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,KAAK,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAID,MAAM,WAAW,0CAA0C;IACzD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,4BAA4B,CAAC;IAClD,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,0CAA0C;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,0CAA0C,CAAC;IAChE,QAAQ,CAAC,YAAY,EAAE,0CAA0C,CAAC;CACnE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Quality Intelligence inline-edit revision contracts (Epic #712, Issue #725).
|
|
2
|
+
//
|
|
3
|
+
// A reviewer may edit a generated test-case body inline on the run card. An edit UPDATES the
|
|
4
|
+
// candidate row in place inside the mutable `candidates[]` artifact AND appends a provenance
|
|
5
|
+
// entry to a new `editedRevisions[]` array. Export/BFF read `candidates[]` unchanged and so
|
|
6
|
+
// automatically reflect edited text; provenance/audit lives in `editedRevisions[]`. The
|
|
7
|
+
// immutable run manifest (`<runId>.qi.json`) is never touched.
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { QualityIntelligenceEvidenceAtomId, QualityIntelligenceSourceEnvelopeId } from "./ids.js";
|
|
2
|
+
export type QualityIntelligenceEvidenceAtomKind = "requirement" | "design-fragment" | "code-fragment" | "document-excerpt" | "human-statement";
|
|
3
|
+
export declare const QUALITY_INTELLIGENCE_EVIDENCE_ATOM_KINDS: readonly QualityIntelligenceEvidenceAtomKind[];
|
|
4
|
+
export type QualityIntelligenceRedactionStatus = "redacted" | "not-required";
|
|
5
|
+
export declare const QUALITY_INTELLIGENCE_REDACTION_STATUSES: readonly QualityIntelligenceRedactionStatus[];
|
|
6
|
+
export type QualityIntelligenceLifecycleStatus = "draft" | "finalised" | "archived";
|
|
7
|
+
export declare const QUALITY_INTELLIGENCE_LIFECYCLE_STATUSES: readonly QualityIntelligenceLifecycleStatus[];
|
|
8
|
+
interface QualityIntelligenceEvidenceAtomCommon {
|
|
9
|
+
readonly id: QualityIntelligenceEvidenceAtomId;
|
|
10
|
+
readonly sourceEnvelopeId: QualityIntelligenceSourceEnvelopeId;
|
|
11
|
+
/** Lowercase hex sha256 of the canonical text of the atom. */
|
|
12
|
+
readonly canonicalHashSha256Hex: string;
|
|
13
|
+
readonly redactionStatus: QualityIntelligenceRedactionStatus;
|
|
14
|
+
readonly lifecycleStatus: QualityIntelligenceLifecycleStatus;
|
|
15
|
+
}
|
|
16
|
+
export interface QualityIntelligenceRequirementAtom extends QualityIntelligenceEvidenceAtomCommon {
|
|
17
|
+
readonly kind: "requirement";
|
|
18
|
+
}
|
|
19
|
+
export interface QualityIntelligenceDesignFragmentAtom extends QualityIntelligenceEvidenceAtomCommon {
|
|
20
|
+
readonly kind: "design-fragment";
|
|
21
|
+
}
|
|
22
|
+
export interface QualityIntelligenceCodeFragmentAtom extends QualityIntelligenceEvidenceAtomCommon {
|
|
23
|
+
readonly kind: "code-fragment";
|
|
24
|
+
}
|
|
25
|
+
export interface QualityIntelligenceDocumentExcerptAtom extends QualityIntelligenceEvidenceAtomCommon {
|
|
26
|
+
readonly kind: "document-excerpt";
|
|
27
|
+
}
|
|
28
|
+
export interface QualityIntelligenceHumanStatementAtom extends QualityIntelligenceEvidenceAtomCommon {
|
|
29
|
+
readonly kind: "human-statement";
|
|
30
|
+
}
|
|
31
|
+
export type QualityIntelligenceEvidenceAtom = QualityIntelligenceRequirementAtom | QualityIntelligenceDesignFragmentAtom | QualityIntelligenceCodeFragmentAtom | QualityIntelligenceDocumentExcerptAtom | QualityIntelligenceHumanStatementAtom;
|
|
32
|
+
/** Pure structural guard: returns true if the atom's hash field looks like sha256 hex. */
|
|
33
|
+
export declare const hasCanonicalSha256Hash: (atom: QualityIntelligenceEvidenceAtom) => boolean;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=evidenceAtom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidenceAtom.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/evidenceAtom.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACV,iCAAiC,EACjC,mCAAmC,EACpC,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,mCAAmC,GA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AA0F;AAC1F,eAAO,MAAM,sBAAsB,GAAI,MAAM,+BAA+B,KAAG,OAC1B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Quality Intelligence evidence atom (Epic #270, Issue #277).
|
|
2
|
+
//
|
|
3
|
+
// An atom is the smallest reviewable provenance unit. Atoms are produced by
|
|
4
|
+
// dereferencing a `QualityIntelligenceSourceEnvelope` and slicing the underlying
|
|
5
|
+
// content into a single coherent claim. The contract surface NEVER carries raw
|
|
6
|
+
// content — only:
|
|
7
|
+
// * the atom id
|
|
8
|
+
// * the source envelope id it was derived from
|
|
9
|
+
// * a canonical hash of the content (so audit can detect drift)
|
|
10
|
+
// * a redaction status marker
|
|
11
|
+
// * a lifecycle status
|
|
12
|
+
//
|
|
13
|
+
// Discriminated union over `kind`:
|
|
14
|
+
// * requirement — atomic acceptance criterion / behaviour statement
|
|
15
|
+
// * design-fragment — UI/UX intent fragment (e.g. a Figma frame caption)
|
|
16
|
+
// * code-fragment — code-level claim (e.g. a function signature)
|
|
17
|
+
// * document-excerpt — passage from a connector document
|
|
18
|
+
// * human-statement — human-authored claim (Conversation Center)
|
|
19
|
+
export const QUALITY_INTELLIGENCE_EVIDENCE_ATOM_KINDS = [
|
|
20
|
+
"requirement",
|
|
21
|
+
"design-fragment",
|
|
22
|
+
"code-fragment",
|
|
23
|
+
"document-excerpt",
|
|
24
|
+
"human-statement",
|
|
25
|
+
];
|
|
26
|
+
export const QUALITY_INTELLIGENCE_REDACTION_STATUSES = ["redacted", "not-required"];
|
|
27
|
+
export const QUALITY_INTELLIGENCE_LIFECYCLE_STATUSES = ["draft", "finalised", "archived"];
|
|
28
|
+
/** Pure structural guard: returns true if the atom's hash field looks like sha256 hex. */
|
|
29
|
+
export const hasCanonicalSha256Hash = (atom) => /^[0-9a-f]{64}$/u.test(atom.canonicalHashSha256Hex);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { QualityIntelligenceCoverageMapId, QualityIntelligenceExportBundleId, QualityIntelligenceRunId, QualityIntelligenceTestCaseId, QualityIntelligenceValidationFindingId } from "./ids.js";
|
|
2
|
+
export type QualityIntelligenceExportAdapter = "jira-issues" | "qtest" | "xray" | "polarion" | "alm" | "csv" | "json" | "spreadsheet-safe-csv" | "markdown" | "plain-text" | "quality-center";
|
|
3
|
+
export declare const QUALITY_INTELLIGENCE_EXPORT_ADAPTERS: readonly QualityIntelligenceExportAdapter[];
|
|
4
|
+
/** Adapters whose target is an external TMS — they require a redaction attestation. */
|
|
5
|
+
export declare const QUALITY_INTELLIGENCE_TMS_ADAPTERS: ReadonlySet<QualityIntelligenceExportAdapter>;
|
|
6
|
+
export interface QualityIntelligenceExportBundleEntry {
|
|
7
|
+
readonly candidateId: QualityIntelligenceTestCaseId;
|
|
8
|
+
readonly coverageMapRefs: readonly QualityIntelligenceCoverageMapId[];
|
|
9
|
+
readonly findingRefs: readonly QualityIntelligenceValidationFindingId[];
|
|
10
|
+
}
|
|
11
|
+
export interface QualityIntelligenceExportBundle {
|
|
12
|
+
readonly id: QualityIntelligenceExportBundleId;
|
|
13
|
+
readonly runId: QualityIntelligenceRunId;
|
|
14
|
+
readonly targetAdapter: QualityIntelligenceExportAdapter;
|
|
15
|
+
/** ISO 8601 timestamp. */
|
|
16
|
+
readonly createdAt: string;
|
|
17
|
+
/** Lowercase hex sha256 over the canonical refs payload. */
|
|
18
|
+
readonly integrityHashSha256Hex: string;
|
|
19
|
+
readonly redactionAttested: boolean;
|
|
20
|
+
readonly contents: readonly QualityIntelligenceExportBundleEntry[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Enforce that a TMS-targeted bundle attests redaction, and that the integrity hash
|
|
24
|
+
* field is a well-formed sha256 hex string. Throws `Error` on violation; returns
|
|
25
|
+
* `void` on success.
|
|
26
|
+
*/
|
|
27
|
+
export declare const assertExportBundleInvariant: (bundle: QualityIntelligenceExportBundle) => void;
|
|
28
|
+
//# sourceMappingURL=exportBundle.d.ts.map
|
|
@@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
|
+
// Quality Intelligence export bundle (Epic #270, Issue #277).
|
|
2
|
+
//
|
|
3
|
+
// An export bundle is a refs-only manifest of which candidates / coverage maps /
|
|
4
|
+
// findings to send to a downstream Test-Management System (TMS) or spreadsheet
|
|
5
|
+
// target. RAW CONTENT IS NEVER EMBEDDED — the runtime (#283) resolves refs and
|
|
6
|
+
// composes the wire payload at export time, applying TMS-specific redaction.
|
|
7
|
+
//
|
|
8
|
+
// Invariant: any TMS-targeted bundle MUST carry `redactionAttested === true`. The
|
|
9
|
+
// helper `assertExportBundleInvariant` enforces this so #283 cannot ship a bundle
|
|
10
|
+
// to a TMS without an attestation. Pure CSV/JSON/spreadsheet targets do not require
|
|
11
|
+
// attestation (the user has explicitly chosen a portable format).
|
|
12
|
+
export const QUALITY_INTELLIGENCE_EXPORT_ADAPTERS = [
|
|
13
|
+
"jira-issues",
|
|
14
|
+
"qtest",
|
|
15
|
+
"xray",
|
|
16
|
+
"polarion",
|
|
17
|
+
"alm",
|
|
18
|
+
"csv",
|
|
19
|
+
"json",
|
|
20
|
+
"spreadsheet-safe-csv",
|
|
21
|
+
"markdown",
|
|
22
|
+
"plain-text",
|
|
23
|
+
"quality-center",
|
|
24
|
+
];
|
|
25
|
+
/** Adapters whose target is an external TMS — they require a redaction attestation. */
|
|
26
|
+
export const QUALITY_INTELLIGENCE_TMS_ADAPTERS = new Set([
|
|
27
|
+
"jira-issues",
|
|
28
|
+
"qtest",
|
|
29
|
+
"xray",
|
|
30
|
+
"polarion",
|
|
31
|
+
"alm",
|
|
32
|
+
"quality-center",
|
|
33
|
+
]);
|
|
34
|
+
/**
|
|
35
|
+
* Enforce that a TMS-targeted bundle attests redaction, and that the integrity hash
|
|
36
|
+
* field is a well-formed sha256 hex string. Throws `Error` on violation; returns
|
|
37
|
+
* `void` on success.
|
|
38
|
+
*/
|
|
39
|
+
export const assertExportBundleInvariant = (bundle) => {
|
|
40
|
+
if (!/^[0-9a-f]{64}$/u.test(bundle.integrityHashSha256Hex)) {
|
|
41
|
+
throw new Error(`Export bundle integrity hash must be a lowercase sha256 hex string (id=${bundle.id})`);
|
|
42
|
+
}
|
|
43
|
+
if (QUALITY_INTELLIGENCE_TMS_ADAPTERS.has(bundle.targetAdapter) && !bundle.redactionAttested) {
|
|
44
|
+
throw new Error(`Export bundle targeting TMS adapter "${bundle.targetAdapter}" requires redactionAttested === true (id=${bundle.id})`);
|
|
45
|
+
}
|
|
46
|
+
};
|