@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,23 @@
|
|
|
1
|
+
import type { QualityIntelligenceRunId, QualityIntelligenceSourceEnvelopeId } from "./ids.js";
|
|
2
|
+
export type QualityIntelligenceHandoffPromptedAction = "design-tests" | "validate-tests" | "review-coverage" | "request-export";
|
|
3
|
+
export declare const QUALITY_INTELLIGENCE_HANDOFF_PROMPTED_ACTIONS: readonly QualityIntelligenceHandoffPromptedAction[];
|
|
4
|
+
/**
|
|
5
|
+
* Opaque ref to the originating Conversation Center chat message. Branded only as
|
|
6
|
+
* a string here to keep this contract surface decoupled from `bff-wire.ts` (which
|
|
7
|
+
* declares the chat-side branded types). The QI runtime resolves the ref against
|
|
8
|
+
* the chat store at handoff time.
|
|
9
|
+
*/
|
|
10
|
+
export type QualityIntelligenceHandoffChatMessageRef = string;
|
|
11
|
+
export interface QualityIntelligenceConversationCenterHandoff {
|
|
12
|
+
/** Stable id minted by the Conversation Center at the moment of the handoff. */
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly requestedByChatMessageId: QualityIntelligenceHandoffChatMessageRef;
|
|
15
|
+
/** Present once a QI run has been allocated for this handoff. */
|
|
16
|
+
readonly runId?: QualityIntelligenceRunId;
|
|
17
|
+
readonly promptedAction: QualityIntelligenceHandoffPromptedAction;
|
|
18
|
+
/** Envelope ids only — no chat content, no body, no excerpts. */
|
|
19
|
+
readonly payloadRef: {
|
|
20
|
+
readonly sourceEnvelopeIds: readonly QualityIntelligenceSourceEnvelopeId[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=handoffEnvelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handoffEnvelope.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/handoffEnvelope.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AAE9F,MAAM,MAAM,wCAAwC,GAChD,cAAc,GACd,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,CAAC;AAErB,eAAO,MAAM,6CAA6C,EAAE,SAAS,wCAAwC,EAC3B,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,MAAM,wCAAwC,GAAG,MAAM,CAAC;AAE9D,MAAM,WAAW,4CAA4C;IAC3D,gFAAgF;IAChF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,wBAAwB,EAAE,wCAAwC,CAAC;IAC5E,iEAAiE;IACjE,QAAQ,CAAC,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,wCAAwC,CAAC;IAClE,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,iBAAiB,EAAE,SAAS,mCAAmC,EAAE,CAAC;KAC5E,CAAC;CACH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Quality Intelligence Conversation Center handoff envelope (Epic #270, Issue #277).
|
|
2
|
+
//
|
|
3
|
+
// The handoff envelope is the typed message a Conversation Center chat sends to the
|
|
4
|
+
// QI workflow runtime to request a QI action. THE ENVELOPE CARRIES ONLY REFERENCES
|
|
5
|
+
// (chat message id, run id, envelope id refs) — NEVER chat content. The QI runtime
|
|
6
|
+
// (#281 integration) is responsible for resolving the refs against the
|
|
7
|
+
// Conversation Center store under the workflow handoff contract (#186).
|
|
8
|
+
export const QUALITY_INTELLIGENCE_HANDOFF_PROMPTED_ACTIONS = ["design-tests", "validate-tests", "review-coverage", "request-export"];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
declare const QualityIntelligenceRunIdBrand: unique symbol;
|
|
2
|
+
declare const QualityIntelligenceTestCaseIdBrand: unique symbol;
|
|
3
|
+
declare const QualityIntelligenceCoverageMapIdBrand: unique symbol;
|
|
4
|
+
declare const QualityIntelligenceValidationFindingIdBrand: unique symbol;
|
|
5
|
+
declare const QualityIntelligenceReviewRecordIdBrand: unique symbol;
|
|
6
|
+
declare const QualityIntelligenceExportBundleIdBrand: unique symbol;
|
|
7
|
+
declare const QualityIntelligenceSourceEnvelopeIdBrand: unique symbol;
|
|
8
|
+
declare const QualityIntelligenceEvidenceAtomIdBrand: unique symbol;
|
|
9
|
+
declare const QualityIntelligenceAuditSummaryIdBrand: unique symbol;
|
|
10
|
+
export type QualityIntelligenceRunId = string & {
|
|
11
|
+
readonly [QualityIntelligenceRunIdBrand]: true;
|
|
12
|
+
};
|
|
13
|
+
export type QualityIntelligenceTestCaseId = string & {
|
|
14
|
+
readonly [QualityIntelligenceTestCaseIdBrand]: true;
|
|
15
|
+
};
|
|
16
|
+
export type QualityIntelligenceCoverageMapId = string & {
|
|
17
|
+
readonly [QualityIntelligenceCoverageMapIdBrand]: true;
|
|
18
|
+
};
|
|
19
|
+
export type QualityIntelligenceValidationFindingId = string & {
|
|
20
|
+
readonly [QualityIntelligenceValidationFindingIdBrand]: true;
|
|
21
|
+
};
|
|
22
|
+
export type QualityIntelligenceReviewRecordId = string & {
|
|
23
|
+
readonly [QualityIntelligenceReviewRecordIdBrand]: true;
|
|
24
|
+
};
|
|
25
|
+
export type QualityIntelligenceExportBundleId = string & {
|
|
26
|
+
readonly [QualityIntelligenceExportBundleIdBrand]: true;
|
|
27
|
+
};
|
|
28
|
+
export type QualityIntelligenceSourceEnvelopeId = string & {
|
|
29
|
+
readonly [QualityIntelligenceSourceEnvelopeIdBrand]: true;
|
|
30
|
+
};
|
|
31
|
+
export type QualityIntelligenceEvidenceAtomId = string & {
|
|
32
|
+
readonly [QualityIntelligenceEvidenceAtomIdBrand]: true;
|
|
33
|
+
};
|
|
34
|
+
export type QualityIntelligenceAuditSummaryId = string & {
|
|
35
|
+
readonly [QualityIntelligenceAuditSummaryIdBrand]: true;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Validates a candidate string is acceptable as a QI branded id, returning a typed
|
|
39
|
+
* error message on rejection. Pure — no IO. Exported only for tests; production
|
|
40
|
+
* callers should use the `asX` constructors.
|
|
41
|
+
*/
|
|
42
|
+
export declare const validateQualityIntelligenceIdString: (value: unknown, kind: string) => {
|
|
43
|
+
ok: true;
|
|
44
|
+
} | {
|
|
45
|
+
ok: false;
|
|
46
|
+
reason: string;
|
|
47
|
+
};
|
|
48
|
+
export declare const asQualityIntelligenceRunId: (value: string) => QualityIntelligenceRunId;
|
|
49
|
+
export declare const asQualityIntelligenceTestCaseId: (value: string) => QualityIntelligenceTestCaseId;
|
|
50
|
+
export declare const asQualityIntelligenceCoverageMapId: (value: string) => QualityIntelligenceCoverageMapId;
|
|
51
|
+
export declare const asQualityIntelligenceValidationFindingId: (value: string) => QualityIntelligenceValidationFindingId;
|
|
52
|
+
export declare const asQualityIntelligenceReviewRecordId: (value: string) => QualityIntelligenceReviewRecordId;
|
|
53
|
+
export declare const asQualityIntelligenceExportBundleId: (value: string) => QualityIntelligenceExportBundleId;
|
|
54
|
+
export declare const asQualityIntelligenceSourceEnvelopeId: (value: string) => QualityIntelligenceSourceEnvelopeId;
|
|
55
|
+
export declare const asQualityIntelligenceEvidenceAtomId: (value: string) => QualityIntelligenceEvidenceAtomId;
|
|
56
|
+
export declare const asQualityIntelligenceAuditSummaryId: (value: string) => QualityIntelligenceAuditSummaryId;
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/ids.ts"],"names":[],"mappings":"AAwBA,OAAO,CAAC,MAAM,6BAA6B,EAAE,OAAO,MAAM,CAAC;AAC3D,OAAO,CAAC,MAAM,kCAAkC,EAAE,OAAO,MAAM,CAAC;AAChE,OAAO,CAAC,MAAM,qCAAqC,EAAE,OAAO,MAAM,CAAC;AACnE,OAAO,CAAC,MAAM,2CAA2C,EAAE,OAAO,MAAM,CAAC;AACzE,OAAO,CAAC,MAAM,sCAAsC,EAAE,OAAO,MAAM,CAAC;AACpE,OAAO,CAAC,MAAM,sCAAsC,EAAE,OAAO,MAAM,CAAC;AACpE,OAAO,CAAC,MAAM,wCAAwC,EAAE,OAAO,MAAM,CAAC;AACtE,OAAO,CAAC,MAAM,sCAAsC,EAAE,OAAO,MAAM,CAAC;AACpE,OAAO,CAAC,MAAM,sCAAsC,EAAE,OAAO,MAAM,CAAC;AAGpE,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG;IAC9C,QAAQ,CAAC,CAAC,6BAA6B,CAAC,EAAE,IAAI,CAAC;CAChD,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,MAAM,GAAG;IACnD,QAAQ,CAAC,CAAC,kCAAkC,CAAC,EAAE,IAAI,CAAC;CACrD,CAAC;AACF,MAAM,MAAM,gCAAgC,GAAG,MAAM,GAAG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mCAAmC,GAC9C,OAAO,MAAM,KACZ,iCACyF,CAAC;AAE7F,eAAO,MAAM,mCAAmC,GAC9C,OAAO,MAAM,KACZ,iCACyF,CAAC;AAE7F,eAAO,MAAM,qCAAqC,GAChD,OAAO,MAAM,KACZ,mCAC6F,CAAC;AAEjG,eAAO,MAAM,mCAAmC,GAC9C,OAAO,MAAM,KACZ,iCACyF,CAAC;AAE7F,eAAO,MAAM,mCAAmC,GAC9C,OAAO,MAAM,KACZ,iCACyF,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Branded ID types for the Quality Intelligence contract surface (Epic #270, Issue #277).
|
|
2
|
+
//
|
|
3
|
+
// Pure types and pure runtime validators only — no IO, no clock reads, no hashing, no
|
|
4
|
+
// randomness. Leaf-package rule (ADR-0019 direction 1): no `@oscharko-dev/keiko-*` imports
|
|
5
|
+
// may appear in this module.
|
|
6
|
+
//
|
|
7
|
+
// Branding follows the same `unique symbol` phantom-property style as
|
|
8
|
+
// `local-knowledge.ts` (KnowledgeCapsuleId etc.): the brand carrier never lands at
|
|
9
|
+
// runtime, so values survive JSON round-trips intact, but a bare `string` is not
|
|
10
|
+
// assignable to a branded type without an explicit `asX(...)` construction step.
|
|
11
|
+
//
|
|
12
|
+
// Each constructor enforces:
|
|
13
|
+
// * non-empty after trim
|
|
14
|
+
// * NFKC normalisation (rejected if normalisation would change the input — callers
|
|
15
|
+
// must normalise themselves, so a brand never silently rewrites a value)
|
|
16
|
+
// * max length 256
|
|
17
|
+
// * no path-traversal segment ("..", "/", "\")
|
|
18
|
+
// * no NUL or other ASCII control characters
|
|
19
|
+
//
|
|
20
|
+
// These rules deliberately match the audit-ledger `assertValidRunId` shape (ADR-0010,
|
|
21
|
+
// memory: keiko-issue10-audit-ledger) so an ID minted in QI can be safely composed
|
|
22
|
+
// with that surface in #274 without re-validation.
|
|
23
|
+
// ─── Validation primitive ──────────────────────────────────────────────────────
|
|
24
|
+
const QI_ID_MAX_LENGTH = 256;
|
|
25
|
+
// Path-traversal segments and structural separators. NUL plus C0/C1 control ranges
|
|
26
|
+
// are caught by the control-character check below.
|
|
27
|
+
const QI_ID_FORBIDDEN_FRAGMENTS = ["..", "/", "\\"];
|
|
28
|
+
const hasControlCharacter = (value) => {
|
|
29
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
30
|
+
const code = value.charCodeAt(index);
|
|
31
|
+
// C0 controls 0x00–0x1F, DEL 0x7F, C1 controls 0x80–0x9F.
|
|
32
|
+
if (code <= 0x1f || code === 0x7f || (code >= 0x80 && code <= 0x9f)) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
};
|
|
38
|
+
const hasForbiddenFragment = (value) => QI_ID_FORBIDDEN_FRAGMENTS.some((fragment) => value.includes(fragment));
|
|
39
|
+
/**
|
|
40
|
+
* Validates a candidate string is acceptable as a QI branded id, returning a typed
|
|
41
|
+
* error message on rejection. Pure — no IO. Exported only for tests; production
|
|
42
|
+
* callers should use the `asX` constructors.
|
|
43
|
+
*/
|
|
44
|
+
export const validateQualityIntelligenceIdString = (value, kind) => {
|
|
45
|
+
if (typeof value !== "string") {
|
|
46
|
+
return { ok: false, reason: `${kind} must be a string` };
|
|
47
|
+
}
|
|
48
|
+
if (value.length === 0) {
|
|
49
|
+
return { ok: false, reason: `${kind} must not be empty` };
|
|
50
|
+
}
|
|
51
|
+
if (value.trim().length === 0) {
|
|
52
|
+
return { ok: false, reason: `${kind} must not be whitespace-only` };
|
|
53
|
+
}
|
|
54
|
+
if (value !== value.trim()) {
|
|
55
|
+
return { ok: false, reason: `${kind} must not have leading or trailing whitespace` };
|
|
56
|
+
}
|
|
57
|
+
if (value.length > QI_ID_MAX_LENGTH) {
|
|
58
|
+
return { ok: false, reason: `${kind} exceeds max length ${String(QI_ID_MAX_LENGTH)}` };
|
|
59
|
+
}
|
|
60
|
+
if (value.normalize("NFKC") !== value) {
|
|
61
|
+
return { ok: false, reason: `${kind} must be NFKC-normalised` };
|
|
62
|
+
}
|
|
63
|
+
if (hasControlCharacter(value)) {
|
|
64
|
+
return { ok: false, reason: `${kind} contains control characters` };
|
|
65
|
+
}
|
|
66
|
+
if (hasForbiddenFragment(value)) {
|
|
67
|
+
return { ok: false, reason: `${kind} contains forbidden path fragment` };
|
|
68
|
+
}
|
|
69
|
+
return { ok: true };
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Validate `value` and return it unchanged. Throws `TypeError` on rejection. The
|
|
73
|
+
* caller casts the returned string to the appropriate branded type — keeping the
|
|
74
|
+
* cast at the constructor site rather than inside this helper avoids an
|
|
75
|
+
* unnecessary type parameter (lint: no-unnecessary-type-parameters).
|
|
76
|
+
*/
|
|
77
|
+
const construct = (value, kind) => {
|
|
78
|
+
const result = validateQualityIntelligenceIdString(value, kind);
|
|
79
|
+
if (!result.ok) {
|
|
80
|
+
throw new TypeError(`Invalid ${kind}: ${result.reason}`);
|
|
81
|
+
}
|
|
82
|
+
return value;
|
|
83
|
+
};
|
|
84
|
+
// ─── Constructors ──────────────────────────────────────────────────────────────
|
|
85
|
+
export const asQualityIntelligenceRunId = (value) => construct(value, "QualityIntelligenceRunId");
|
|
86
|
+
export const asQualityIntelligenceTestCaseId = (value) => construct(value, "QualityIntelligenceTestCaseId");
|
|
87
|
+
export const asQualityIntelligenceCoverageMapId = (value) => construct(value, "QualityIntelligenceCoverageMapId");
|
|
88
|
+
export const asQualityIntelligenceValidationFindingId = (value) => construct(value, "QualityIntelligenceValidationFindingId");
|
|
89
|
+
export const asQualityIntelligenceReviewRecordId = (value) => construct(value, "QualityIntelligenceReviewRecordId");
|
|
90
|
+
export const asQualityIntelligenceExportBundleId = (value) => construct(value, "QualityIntelligenceExportBundleId");
|
|
91
|
+
export const asQualityIntelligenceSourceEnvelopeId = (value) => construct(value, "QualityIntelligenceSourceEnvelopeId");
|
|
92
|
+
export const asQualityIntelligenceEvidenceAtomId = (value) => construct(value, "QualityIntelligenceEvidenceAtomId");
|
|
93
|
+
export const asQualityIntelligenceAuditSummaryId = (value) => construct(value, "QualityIntelligenceAuditSummaryId");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const QUALITY_INTELLIGENCE_SCHEMA_VERSION: "1";
|
|
2
|
+
export type { QualityIntelligenceRunId, QualityIntelligenceTestCaseId, QualityIntelligenceCoverageMapId, QualityIntelligenceValidationFindingId, QualityIntelligenceReviewRecordId, QualityIntelligenceExportBundleId, QualityIntelligenceSourceEnvelopeId, QualityIntelligenceEvidenceAtomId, QualityIntelligenceAuditSummaryId, } from "./ids.js";
|
|
3
|
+
export { asQualityIntelligenceRunId, asQualityIntelligenceTestCaseId, asQualityIntelligenceCoverageMapId, asQualityIntelligenceValidationFindingId, asQualityIntelligenceReviewRecordId, asQualityIntelligenceExportBundleId, asQualityIntelligenceSourceEnvelopeId, asQualityIntelligenceEvidenceAtomId, asQualityIntelligenceAuditSummaryId, validateQualityIntelligenceIdString, } from "./ids.js";
|
|
4
|
+
export { assertQualityIntelligenceNever } from "./assertNever.js";
|
|
5
|
+
export type { QualityIntelligenceSourceKind, QualityIntelligenceSourceProvenance, QualityIntelligenceRepositoryContextEnvelope, QualityIntelligenceLocalKnowledgeCapsuleEnvelope, QualityIntelligenceFigmaEvidenceEnvelope, QualityIntelligenceHumanContextEnvelope, QualityIntelligenceConnectorDocumentEnvelope, QualityIntelligenceSourceEnvelope, } from "./sourceEnvelope.js";
|
|
6
|
+
export { QUALITY_INTELLIGENCE_SOURCE_KINDS, looksLikeBrowserSafeSourceEnvelope, } from "./sourceEnvelope.js";
|
|
7
|
+
export type { QualityIntelligenceEvidenceAtomKind, QualityIntelligenceRedactionStatus, QualityIntelligenceLifecycleStatus, QualityIntelligenceRequirementAtom, QualityIntelligenceDesignFragmentAtom, QualityIntelligenceCodeFragmentAtom, QualityIntelligenceDocumentExcerptAtom, QualityIntelligenceHumanStatementAtom, QualityIntelligenceEvidenceAtom, } from "./evidenceAtom.js";
|
|
8
|
+
export { QUALITY_INTELLIGENCE_EVIDENCE_ATOM_KINDS, QUALITY_INTELLIGENCE_REDACTION_STATUSES, QUALITY_INTELLIGENCE_LIFECYCLE_STATUSES, hasCanonicalSha256Hash, } from "./evidenceAtom.js";
|
|
9
|
+
export type { QualityIntelligencePriority, QualityIntelligenceRiskClass, QualityIntelligenceTestCaseStatus, QualityIntelligenceTestCaseCandidate, } from "./testCaseCandidate.js";
|
|
10
|
+
export { QUALITY_INTELLIGENCE_PRIORITIES, QUALITY_INTELLIGENCE_RISK_CLASSES, QUALITY_INTELLIGENCE_TEST_CASE_STATUSES, } from "./testCaseCandidate.js";
|
|
11
|
+
export type { QualityIntelligenceCandidateEditProvenance, QualityIntelligenceCandidateEditableFields, QualityIntelligenceCandidateEditedRevision, } from "./editableRevision.js";
|
|
12
|
+
export type { QualityIntelligenceCoverageKind, QualityIntelligenceCoverageMapping, QualityIntelligenceCoverageMap, } from "./coverageMap.js";
|
|
13
|
+
export { QUALITY_INTELLIGENCE_COVERAGE_KINDS, assertCoverageMapInvariant } from "./coverageMap.js";
|
|
14
|
+
export type { QualityIntelligenceValidationFindingKind, QualityIntelligenceSeverity, QualityIntelligenceLogicDefectFinding, QualityIntelligenceFaithfulnessDefectFinding, QualityIntelligenceSemanticDefectFinding, QualityIntelligenceMutationDefectFinding, QualityIntelligencePolicyViolationFinding, QualityIntelligenceManualRejectionFinding, QualityIntelligenceCoverageGapFinding, QualityIntelligenceTestQualityFinding, QualityIntelligenceValidationFinding, } from "./validationFinding.js";
|
|
15
|
+
export { QUALITY_INTELLIGENCE_VALIDATION_FINDING_KINDS, QUALITY_INTELLIGENCE_SEVERITIES, QUALITY_INTELLIGENCE_SEVERITY_RANK, } from "./validationFinding.js";
|
|
16
|
+
export type { QualityIntelligencePlannerKind, QualityIntelligenceRunStage, QualityIntelligenceRunPlan, QualityIntelligenceRunQueuedPayload, QualityIntelligenceRunStartedPayload, QualityIntelligenceStageStartedPayload, QualityIntelligenceStageCompletedPayload, QualityIntelligenceStageFailedPayload, QualityIntelligenceCandidateProposedPayload, QualityIntelligenceFindingRecordedPayload, QualityIntelligenceReviewRequestedPayload, QualityIntelligenceReviewCompletedPayload, QualityIntelligenceRunSucceededPayload, QualityIntelligenceRunFailedPayload, QualityIntelligenceRunCancelledPayload, QualityIntelligenceRunEventPayload, QualityIntelligenceRunEventKind, QualityIntelligenceRunEvent, } from "./runPlanAndEvents.js";
|
|
17
|
+
export { QUALITY_INTELLIGENCE_EVENT_SCHEMA_VERSION, QUALITY_INTELLIGENCE_PLANNER_KINDS, QUALITY_INTELLIGENCE_RUN_EVENT_KINDS, assertRunEventSequenceMonotonic, } from "./runPlanAndEvents.js";
|
|
18
|
+
export type { QualityIntelligenceReviewerKind, QualityIntelligenceReviewState, QualityIntelligenceReviewRecord, } from "./reviewRecord.js";
|
|
19
|
+
export { QUALITY_INTELLIGENCE_REVIEWER_KINDS, QUALITY_INTELLIGENCE_REVIEW_STATES, } from "./reviewRecord.js";
|
|
20
|
+
export type { QualityIntelligenceExportAdapter, QualityIntelligenceExportBundleEntry, QualityIntelligenceExportBundle, } from "./exportBundle.js";
|
|
21
|
+
export { QUALITY_INTELLIGENCE_EXPORT_ADAPTERS, QUALITY_INTELLIGENCE_TMS_ADAPTERS, assertExportBundleInvariant, } from "./exportBundle.js";
|
|
22
|
+
export type { QualityIntelligenceAuditTotals, QualityIntelligenceEvidenceRetentionSummary, QualityIntelligenceAuditSummary, } from "./auditSummary.js";
|
|
23
|
+
export { QUALITY_INTELLIGENCE_AUDIT_MANIFEST_SCHEMA_VERSION } from "./auditSummary.js";
|
|
24
|
+
export type { QualityIntelligenceHandoffPromptedAction, QualityIntelligenceHandoffChatMessageRef, QualityIntelligenceConversationCenterHandoff, } from "./handoffEnvelope.js";
|
|
25
|
+
export { QUALITY_INTELLIGENCE_HANDOFF_PROMPTED_ACTIONS } from "./handoffEnvelope.js";
|
|
26
|
+
export type { TestQualityDimensionName, TestQualityRubricDimension, TestQualityJudgeVerdict, } from "./testQualityRubric.js";
|
|
27
|
+
export { TEST_QUALITY_RUBRIC_DIMENSIONS, TEST_QUALITY_JUDGE_RESPONSE_SCHEMA, } from "./testQualityRubric.js";
|
|
28
|
+
export type { QualityIntelligenceUiRunTotals, QualityIntelligenceUiRunSummary, QualityIntelligenceUiRunListResponse, QualityIntelligenceUiFindingSummary, QualityIntelligenceUiEvidenceRef, QualityIntelligenceUiRunDetail, QualityIntelligenceUiAtomCoverage, QualityIntelligenceUiWeakTestFlag, QualityIntelligenceUiDriftMetadata, QualityIntelligenceUiCandidate, QualityIntelligenceInlineSourceKind, QualityIntelligenceRequirementsSource, QualityIntelligenceWorkspaceSource, QualityIntelligenceFileSource, QualityIntelligenceCapsuleSource, QualityIntelligenceCapsuleSetSource, QualityIntelligenceFigmaSnapshotSource, QualityIntelligenceImageSource, QualityIntelligenceInlineSource, QualityIntelligenceUiStalenessEntry, QualityIntelligenceUiStalenessReport, QualityIntelligenceUiRegenerateResult, QualityIntelligenceStartRunRequest, QualityIntelligenceSkippedSource, QualityIntelligenceRunStreamAccepted, QualityIntelligenceRunStreamEvent, QualityIntelligenceRunStreamDone, QualityIntelligenceRunStreamError, QualityIntelligenceRunStreamMessage, } from "./bffWire.js";
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mCAAmC,EAAG,GAAY,CAAC;AAGhE,YAAY,EACV,wBAAwB,EACxB,6BAA6B,EAC7B,gCAAgC,EAChC,sCAAsC,EACtC,iCAAiC,EACjC,iCAAiC,EACjC,mCAAmC,EACnC,iCAAiC,EACjC,iCAAiC,GAClC,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,kCAAkC,EAClC,wCAAwC,EACxC,mCAAmC,EACnC,mCAAmC,EACnC,qCAAqC,EACr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Y,EACV,8BAA8B,EAC9B,+BAA+B,EAC/B,oCAAoC,EACpC,mCAAmC,EACnC,gCAAgC,EAChC,8BAA8B,EAC9B,iCAAiC,EACjC,iCAAiC,EACjC,kCAAkC,EAClC,8BAA8B,EAC9B,mCAAmC,EACnC,qCAAqC,EACrC,kCAAkC,EAClC,6BAA6B,EAC7B,gCAAgC,EAChC,mCAAmC,EACnC,sCAAsC,EACtC,8BAA8B,EAC9B,+BAA+B,EAC/B,mCAAmC,EACnC,oCAAoC,EACpC,qCAAqC,EACrC,kCAAkC,EAClC,gCAAgC,EAChC,oCAAoC,EACpC,iCAAiC,EACjC,gCAAgC,EAChC,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Public barrel for the Quality Intelligence contract surface (Epic #270, Issue #277).
|
|
2
|
+
//
|
|
3
|
+
// Pure leaf module. Re-exports every type, constant, and validator from this directory
|
|
4
|
+
// for consumption via `@oscharko-dev/keiko-contracts` (which re-exports this barrel
|
|
5
|
+
// under the `QualityIntelligence` namespace).
|
|
6
|
+
export const QUALITY_INTELLIGENCE_SCHEMA_VERSION = "1";
|
|
7
|
+
export { asQualityIntelligenceRunId, asQualityIntelligenceTestCaseId, asQualityIntelligenceCoverageMapId, asQualityIntelligenceValidationFindingId, asQualityIntelligenceReviewRecordId, asQualityIntelligenceExportBundleId, asQualityIntelligenceSourceEnvelopeId, asQualityIntelligenceEvidenceAtomId, asQualityIntelligenceAuditSummaryId, validateQualityIntelligenceIdString, } from "./ids.js";
|
|
8
|
+
// ─── Exhaustiveness helper ─────────────────────────────────────────────────────
|
|
9
|
+
export { assertQualityIntelligenceNever } from "./assertNever.js";
|
|
10
|
+
export { QUALITY_INTELLIGENCE_SOURCE_KINDS, looksLikeBrowserSafeSourceEnvelope, } from "./sourceEnvelope.js";
|
|
11
|
+
export { QUALITY_INTELLIGENCE_EVIDENCE_ATOM_KINDS, QUALITY_INTELLIGENCE_REDACTION_STATUSES, QUALITY_INTELLIGENCE_LIFECYCLE_STATUSES, hasCanonicalSha256Hash, } from "./evidenceAtom.js";
|
|
12
|
+
export { QUALITY_INTELLIGENCE_PRIORITIES, QUALITY_INTELLIGENCE_RISK_CLASSES, QUALITY_INTELLIGENCE_TEST_CASE_STATUSES, } from "./testCaseCandidate.js";
|
|
13
|
+
export { QUALITY_INTELLIGENCE_COVERAGE_KINDS, assertCoverageMapInvariant } from "./coverageMap.js";
|
|
14
|
+
export { QUALITY_INTELLIGENCE_VALIDATION_FINDING_KINDS, QUALITY_INTELLIGENCE_SEVERITIES, QUALITY_INTELLIGENCE_SEVERITY_RANK, } from "./validationFinding.js";
|
|
15
|
+
export { QUALITY_INTELLIGENCE_EVENT_SCHEMA_VERSION, QUALITY_INTELLIGENCE_PLANNER_KINDS, QUALITY_INTELLIGENCE_RUN_EVENT_KINDS, assertRunEventSequenceMonotonic, } from "./runPlanAndEvents.js";
|
|
16
|
+
export { QUALITY_INTELLIGENCE_REVIEWER_KINDS, QUALITY_INTELLIGENCE_REVIEW_STATES, } from "./reviewRecord.js";
|
|
17
|
+
export { QUALITY_INTELLIGENCE_EXPORT_ADAPTERS, QUALITY_INTELLIGENCE_TMS_ADAPTERS, assertExportBundleInvariant, } from "./exportBundle.js";
|
|
18
|
+
export { QUALITY_INTELLIGENCE_AUDIT_MANIFEST_SCHEMA_VERSION } from "./auditSummary.js";
|
|
19
|
+
export { QUALITY_INTELLIGENCE_HANDOFF_PROMPTED_ACTIONS } from "./handoffEnvelope.js";
|
|
20
|
+
export { TEST_QUALITY_RUBRIC_DIMENSIONS, TEST_QUALITY_JUDGE_RESPONSE_SCHEMA, } from "./testQualityRubric.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { QualityIntelligenceReviewRecordId, QualityIntelligenceRunId } from "./ids.js";
|
|
2
|
+
export type QualityIntelligenceReviewerKind = "human-author" | "human-reviewer" | "judge";
|
|
3
|
+
export declare const QUALITY_INTELLIGENCE_REVIEWER_KINDS: readonly QualityIntelligenceReviewerKind[];
|
|
4
|
+
export type QualityIntelligenceReviewState = "open" | "approved" | "changes-requested" | "rejected" | "withdrawn";
|
|
5
|
+
export declare const QUALITY_INTELLIGENCE_REVIEW_STATES: readonly QualityIntelligenceReviewState[];
|
|
6
|
+
export interface QualityIntelligenceReviewRecord {
|
|
7
|
+
readonly id: QualityIntelligenceReviewRecordId;
|
|
8
|
+
readonly runId: QualityIntelligenceRunId;
|
|
9
|
+
readonly reviewerKind: QualityIntelligenceReviewerKind;
|
|
10
|
+
/** Display only; no PII guarantee. Callers must redact upstream. */
|
|
11
|
+
readonly reviewerLabel: string;
|
|
12
|
+
readonly state: QualityIntelligenceReviewState;
|
|
13
|
+
/** ISO 8601 timestamp. */
|
|
14
|
+
readonly createdAt: string;
|
|
15
|
+
/** ISO 8601 timestamp. */
|
|
16
|
+
readonly lastUpdatedAt: string;
|
|
17
|
+
readonly fourEyesPairedRecordId?: QualityIntelligenceReviewRecordId;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=reviewRecord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewRecord.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/reviewRecord.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iCAAiC,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAE5F,MAAM,MAAM,+BAA+B,GAAG,cAAc,GAAG,gBAAgB,GAAG,OAAO,CAAC;AAE1F,eAAO,MAAM,mCAAmC,EAAE,SAAS,+BAA+B,EAIhF,CAAC;AAEX,MAAM,MAAM,8BAA8B,GACtC,MAAM,GACN,UAAU,GACV,mBAAmB,GACnB,UAAU,GACV,WAAW,CAAC;AAEhB,eAAO,MAAM,kCAAkC,EAAE,SAAS,8BAA8B,EAM9E,CAAC;AAEX,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,EAAE,EAAE,iCAAiC,CAAC;IAC/C,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,+BAA+B,CAAC;IACvD,oEAAoE;IACpE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,8BAA8B,CAAC;IAC/C,0BAA0B;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0BAA0B;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,sBAAsB,CAAC,EAAE,iCAAiC,CAAC;CACrE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Quality Intelligence review record (Epic #270, Issue #277).
|
|
2
|
+
//
|
|
3
|
+
// A review record tracks the lifecycle of a single review (human author / human
|
|
4
|
+
// reviewer / model judge) over a QI run. The `fourEyesPairedRecordId` field is
|
|
5
|
+
// the optional reference linking two paired reviews when four-eyes governance
|
|
6
|
+
// (#282) requires it. Identifier semantics:
|
|
7
|
+
// * `reviewerLabel` is a display string only; this contract makes NO PII guarantee.
|
|
8
|
+
// * `reviewerKind` is the structural role.
|
|
9
|
+
export const QUALITY_INTELLIGENCE_REVIEWER_KINDS = [
|
|
10
|
+
"human-author",
|
|
11
|
+
"human-reviewer",
|
|
12
|
+
"judge",
|
|
13
|
+
];
|
|
14
|
+
export const QUALITY_INTELLIGENCE_REVIEW_STATES = [
|
|
15
|
+
"open",
|
|
16
|
+
"approved",
|
|
17
|
+
"changes-requested",
|
|
18
|
+
"rejected",
|
|
19
|
+
"withdrawn",
|
|
20
|
+
];
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { QualityIntelligenceEvidenceAtomId, QualityIntelligenceRunId, QualityIntelligenceTestCaseId, QualityIntelligenceValidationFindingId } from "./ids.js";
|
|
2
|
+
export declare const QUALITY_INTELLIGENCE_EVENT_SCHEMA_VERSION: 1;
|
|
3
|
+
export type QualityIntelligencePlannerKind = "scripted" | "model-routed";
|
|
4
|
+
export declare const QUALITY_INTELLIGENCE_PLANNER_KINDS: readonly QualityIntelligencePlannerKind[];
|
|
5
|
+
export interface QualityIntelligenceRunStage {
|
|
6
|
+
/** Stable stage name (e.g. "ingest", "design", "validate", "review"). */
|
|
7
|
+
readonly name: string;
|
|
8
|
+
/** Opaque descriptor identifier the runtime maps to a stage implementation. */
|
|
9
|
+
readonly descriptor: string;
|
|
10
|
+
}
|
|
11
|
+
export interface QualityIntelligenceRunPlan {
|
|
12
|
+
readonly id: QualityIntelligenceRunId;
|
|
13
|
+
/** ISO 8601 timestamp. */
|
|
14
|
+
readonly requestedAt: string;
|
|
15
|
+
readonly plannerKind: QualityIntelligencePlannerKind;
|
|
16
|
+
readonly stages: readonly QualityIntelligenceRunStage[];
|
|
17
|
+
}
|
|
18
|
+
export interface QualityIntelligenceRunQueuedPayload {
|
|
19
|
+
readonly kind: "run:queued";
|
|
20
|
+
}
|
|
21
|
+
export interface QualityIntelligenceRunStartedPayload {
|
|
22
|
+
readonly kind: "run:started";
|
|
23
|
+
}
|
|
24
|
+
export interface QualityIntelligenceStageStartedPayload {
|
|
25
|
+
readonly kind: "stage:started";
|
|
26
|
+
readonly stageName: string;
|
|
27
|
+
}
|
|
28
|
+
export interface QualityIntelligenceStageCompletedPayload {
|
|
29
|
+
readonly kind: "stage:completed";
|
|
30
|
+
readonly stageName: string;
|
|
31
|
+
}
|
|
32
|
+
export interface QualityIntelligenceStageFailedPayload {
|
|
33
|
+
readonly kind: "stage:failed";
|
|
34
|
+
readonly stageName: string;
|
|
35
|
+
/** Non-secret single-sentence failure reason; producer-redacted. */
|
|
36
|
+
readonly reasonSummary: string;
|
|
37
|
+
}
|
|
38
|
+
export interface QualityIntelligenceCandidateProposedPayload {
|
|
39
|
+
readonly kind: "candidate:proposed";
|
|
40
|
+
readonly candidateId: QualityIntelligenceTestCaseId;
|
|
41
|
+
readonly derivedFromAtomIds: readonly QualityIntelligenceEvidenceAtomId[];
|
|
42
|
+
}
|
|
43
|
+
export interface QualityIntelligenceFindingRecordedPayload {
|
|
44
|
+
readonly kind: "finding:recorded";
|
|
45
|
+
readonly findingId: QualityIntelligenceValidationFindingId;
|
|
46
|
+
}
|
|
47
|
+
export interface QualityIntelligenceReviewRequestedPayload {
|
|
48
|
+
readonly kind: "review:requested";
|
|
49
|
+
readonly candidateId: QualityIntelligenceTestCaseId;
|
|
50
|
+
}
|
|
51
|
+
export interface QualityIntelligenceReviewCompletedPayload {
|
|
52
|
+
readonly kind: "review:completed";
|
|
53
|
+
readonly candidateId: QualityIntelligenceTestCaseId;
|
|
54
|
+
}
|
|
55
|
+
export interface QualityIntelligenceRunSucceededPayload {
|
|
56
|
+
readonly kind: "run:succeeded";
|
|
57
|
+
}
|
|
58
|
+
export interface QualityIntelligenceRunFailedPayload {
|
|
59
|
+
readonly kind: "run:failed";
|
|
60
|
+
/** Non-secret single-sentence failure reason; producer-redacted. */
|
|
61
|
+
readonly reasonSummary: string;
|
|
62
|
+
}
|
|
63
|
+
export interface QualityIntelligenceRunCancelledPayload {
|
|
64
|
+
readonly kind: "run:cancelled";
|
|
65
|
+
}
|
|
66
|
+
export type QualityIntelligenceRunEventPayload = QualityIntelligenceRunQueuedPayload | QualityIntelligenceRunStartedPayload | QualityIntelligenceStageStartedPayload | QualityIntelligenceStageCompletedPayload | QualityIntelligenceStageFailedPayload | QualityIntelligenceCandidateProposedPayload | QualityIntelligenceFindingRecordedPayload | QualityIntelligenceReviewRequestedPayload | QualityIntelligenceReviewCompletedPayload | QualityIntelligenceRunSucceededPayload | QualityIntelligenceRunFailedPayload | QualityIntelligenceRunCancelledPayload;
|
|
67
|
+
export type QualityIntelligenceRunEventKind = QualityIntelligenceRunEventPayload["kind"];
|
|
68
|
+
export declare const QUALITY_INTELLIGENCE_RUN_EVENT_KINDS: readonly QualityIntelligenceRunEventKind[];
|
|
69
|
+
export interface QualityIntelligenceRunEvent {
|
|
70
|
+
readonly eventSchemaVersion: typeof QUALITY_INTELLIGENCE_EVENT_SCHEMA_VERSION;
|
|
71
|
+
readonly runId: QualityIntelligenceRunId;
|
|
72
|
+
/** Monotonic per-run non-negative integer. */
|
|
73
|
+
readonly sequence: number;
|
|
74
|
+
/** ISO 8601 timestamp. */
|
|
75
|
+
readonly timestamp: string;
|
|
76
|
+
readonly payload: QualityIntelligenceRunEventPayload;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Assert sequence numbers in `events` are strictly increasing. Returns `void` on
|
|
80
|
+
* success; throws `RangeError` on the first violation (including non-integer or
|
|
81
|
+
* negative values).
|
|
82
|
+
*/
|
|
83
|
+
export declare const assertRunEventSequenceMonotonic: (events: readonly QualityIntelligenceRunEvent[]) => void;
|
|
84
|
+
//# sourceMappingURL=runPlanAndEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runPlanAndEvents.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/runPlanAndEvents.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,iCAAiC,EACjC,wBAAwB,EACxB,6BAA6B,EAC7B,sCAAsC,EACvC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,yCAAyC,EAAG,CAAU,CAAC;AAEpE,MAAM,MAAM,8BAA8B,GAAG,UAAU,GAAG,cAAc,CAAC;AAEzE,eAAO,MAAM,kCAAkC,EAAE,SAAS,8BAA8B,EAG9E,CAAC;AAEX,MAAM,WAAW,2BAA2B;IAC1C,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,wBAAwB,CAAC;IACtC,0BAA0B;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,8BAA8B,CAAC;IACrD,QAAQ,CAAC,MAAM,EAAE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ChC;AAED,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,sCAAsC;IACrD,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;CAChC;AAED,MAAM,MAAM,kCAAkC,GAC1C,mCAAmC,GACnC,oCAAoC,GACpC,sCAAsC,GACtC,wCAAwC,GACxC,qCAAqC,GACrC,2CAA2C,GAC3C,yCAAyC,GACzC,yCAAyC,GACzC,yCAAyC,GACzC,sCAAsC,GACtC,mCAAmC,GACnC,sCAAsC,CAAC;AAE3C,MAAM,MAAM,+BAA+B,GAAG,kCAAkC,CAAC,MAAM,CAAC,CAAC;AAEzF,eAAO,MAAM,oCAAoC,EAAE,SAAS,+BAA+B,EAajF,CAAC;AAEX,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,kBAAkB,EAAE,OAAO,yCAAyC,CAAC;IAC9E,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC;IACzC,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0BAA0B;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,kCAAkC,CAAC;CACtD;AAED;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,GAC1C,QAAQ,SAAS,2BAA2B,EAAE,KAC7C,IAqBF,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Quality Intelligence run plan + versioned run-event envelope (Epic #270, Issue #277).
|
|
2
|
+
//
|
|
3
|
+
// The run plan describes the deterministic stage sequence a QI run will execute. The
|
|
4
|
+
// run-event envelope is the wire-stable record of what actually happened. Both are
|
|
5
|
+
// versioned via the `eventSchemaVersion` literal so future evolutions land as new
|
|
6
|
+
// literal members rather than mutating "1" (same rule as MEMORY_SCHEMA_VERSION /
|
|
7
|
+
// CONNECTED_CONTEXT_SCHEMA_VERSION).
|
|
8
|
+
//
|
|
9
|
+
// Events carry a monotonic per-run `sequence` integer and an ISO 8601 `timestamp`.
|
|
10
|
+
// The runtime (#273) is responsible for assigning sequences in the order events are
|
|
11
|
+
// observed.
|
|
12
|
+
export const QUALITY_INTELLIGENCE_EVENT_SCHEMA_VERSION = 1;
|
|
13
|
+
export const QUALITY_INTELLIGENCE_PLANNER_KINDS = [
|
|
14
|
+
"scripted",
|
|
15
|
+
"model-routed",
|
|
16
|
+
];
|
|
17
|
+
export const QUALITY_INTELLIGENCE_RUN_EVENT_KINDS = [
|
|
18
|
+
"run:queued",
|
|
19
|
+
"run:started",
|
|
20
|
+
"stage:started",
|
|
21
|
+
"stage:completed",
|
|
22
|
+
"stage:failed",
|
|
23
|
+
"candidate:proposed",
|
|
24
|
+
"finding:recorded",
|
|
25
|
+
"review:requested",
|
|
26
|
+
"review:completed",
|
|
27
|
+
"run:succeeded",
|
|
28
|
+
"run:failed",
|
|
29
|
+
"run:cancelled",
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Assert sequence numbers in `events` are strictly increasing. Returns `void` on
|
|
33
|
+
* success; throws `RangeError` on the first violation (including non-integer or
|
|
34
|
+
* negative values).
|
|
35
|
+
*/
|
|
36
|
+
export const assertRunEventSequenceMonotonic = (events) => {
|
|
37
|
+
let previous = -1;
|
|
38
|
+
for (let index = 0; index < events.length; index += 1) {
|
|
39
|
+
const event = events[index];
|
|
40
|
+
if (event === undefined) {
|
|
41
|
+
throw new RangeError(`Run event[${String(index)}] is missing`);
|
|
42
|
+
}
|
|
43
|
+
if (!Number.isInteger(event.sequence) || event.sequence < 0) {
|
|
44
|
+
throw new RangeError(`Run event[${String(index)}] has invalid sequence ${String(event.sequence)}`);
|
|
45
|
+
}
|
|
46
|
+
if (event.sequence <= previous) {
|
|
47
|
+
throw new RangeError(`Run event[${String(index)}] sequence ${String(event.sequence)} is not strictly greater than previous ${String(previous)}`);
|
|
48
|
+
}
|
|
49
|
+
previous = event.sequence;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { QualityIntelligenceSourceEnvelopeId } from "./ids.js";
|
|
2
|
+
export type QualityIntelligenceSourceKind = "repository-context" | "local-knowledge-capsule" | "figma-evidence" | "human-context" | "connector-document";
|
|
3
|
+
export declare const QUALITY_INTELLIGENCE_SOURCE_KINDS: readonly QualityIntelligenceSourceKind[];
|
|
4
|
+
export interface QualityIntelligenceSourceProvenance {
|
|
5
|
+
/** Free-form origin label (e.g. "workspace", "capsule:foo"). Display only. */
|
|
6
|
+
readonly origin: string;
|
|
7
|
+
/** ISO 8601 timestamp (UTC) when the envelope was registered. */
|
|
8
|
+
readonly registeredAt: string;
|
|
9
|
+
/**
|
|
10
|
+
* Lowercase hex sha256 of the underlying content. The contract surface never
|
|
11
|
+
* carries the content itself; this hash exists so the audit ledger can detect
|
|
12
|
+
* drift between envelope registration and downstream reads.
|
|
13
|
+
*/
|
|
14
|
+
readonly integrityHashSha256Hex: string;
|
|
15
|
+
}
|
|
16
|
+
interface QualityIntelligenceSourceEnvelopeCommon {
|
|
17
|
+
readonly id: QualityIntelligenceSourceEnvelopeId;
|
|
18
|
+
/** Non-secret display label. Must not contain credentials or URLs. */
|
|
19
|
+
readonly displayLabel: string;
|
|
20
|
+
readonly provenance: QualityIntelligenceSourceProvenance;
|
|
21
|
+
}
|
|
22
|
+
export interface QualityIntelligenceRepositoryContextEnvelope extends QualityIntelligenceSourceEnvelopeCommon {
|
|
23
|
+
readonly kind: "repository-context";
|
|
24
|
+
/** Opaque ref to a workspace scope or path (resolved by keiko-workspace). */
|
|
25
|
+
readonly localRef: string;
|
|
26
|
+
}
|
|
27
|
+
export interface QualityIntelligenceLocalKnowledgeCapsuleEnvelope extends QualityIntelligenceSourceEnvelopeCommon {
|
|
28
|
+
readonly kind: "local-knowledge-capsule";
|
|
29
|
+
/** Opaque ref to a KnowledgeCapsule (resolved by keiko-local-knowledge). */
|
|
30
|
+
readonly localRef: string;
|
|
31
|
+
}
|
|
32
|
+
export interface QualityIntelligenceFigmaEvidenceEnvelope extends QualityIntelligenceSourceEnvelopeCommon {
|
|
33
|
+
readonly kind: "figma-evidence";
|
|
34
|
+
/** Opaque ref to a local Figma evidence cache entry. NOT a Figma URL. */
|
|
35
|
+
readonly localRef: string;
|
|
36
|
+
}
|
|
37
|
+
export interface QualityIntelligenceHumanContextEnvelope extends QualityIntelligenceSourceEnvelopeCommon {
|
|
38
|
+
readonly kind: "human-context";
|
|
39
|
+
/** Opaque ref to a Conversation Center human-context note id. */
|
|
40
|
+
readonly localRef: string;
|
|
41
|
+
}
|
|
42
|
+
export interface QualityIntelligenceConnectorDocumentEnvelope extends QualityIntelligenceSourceEnvelopeCommon {
|
|
43
|
+
readonly kind: "connector-document";
|
|
44
|
+
/** Opaque ref to a connector-document id (resolved by an adapter). */
|
|
45
|
+
readonly localRef: string;
|
|
46
|
+
/**
|
|
47
|
+
* Stable identifier of the connector adapter that vended `localRef`. Display only;
|
|
48
|
+
* not authoritative for security decisions.
|
|
49
|
+
*/
|
|
50
|
+
readonly adapterId: string;
|
|
51
|
+
}
|
|
52
|
+
export type QualityIntelligenceSourceEnvelope = QualityIntelligenceRepositoryContextEnvelope | QualityIntelligenceLocalKnowledgeCapsuleEnvelope | QualityIntelligenceFigmaEvidenceEnvelope | QualityIntelligenceHumanContextEnvelope | QualityIntelligenceConnectorDocumentEnvelope;
|
|
53
|
+
/**
|
|
54
|
+
* Cheap structural guard: rejects envelopes that look like they may carry credentials,
|
|
55
|
+
* URLs, or oversized labels in their display surface. Pure, no IO.
|
|
56
|
+
*
|
|
57
|
+
* Scanned fields: `displayLabel`, `localRef`, `provenance.origin`, and (for
|
|
58
|
+
* `connector-document` envelopes) `adapterId`.
|
|
59
|
+
*
|
|
60
|
+
* Rejected when ANY scanned field contains:
|
|
61
|
+
* - a URL with an authority (`scheme://` for any scheme)
|
|
62
|
+
* - a well-known credential shape (AWS AKIA*, GitHub ghp_/gho_/github_pat_*,
|
|
63
|
+
* Slack xox[baprs]-, OpenAI sk-*, Bearer token, PEM PRIVATE KEY header)
|
|
64
|
+
* - an absolute filesystem path (POSIX `/`, Windows drive, or UNC `\\`)
|
|
65
|
+
* - a bidi-override/isolate, zero-width, BOM, LRM/RLM, or Arabic-letter-mark code point
|
|
66
|
+
*
|
|
67
|
+
* Additionally rejects when:
|
|
68
|
+
* - `displayLabel` is empty or exceeds 256 characters
|
|
69
|
+
* - `displayLabel` looks base64-ish (≥40 chars of the base64 alphabet)
|
|
70
|
+
* - `provenance.integrityHashSha256Hex` is not a 64-char lowercase hex string
|
|
71
|
+
*
|
|
72
|
+
* The runtime that builds envelopes is responsible for ALL redaction; this helper is
|
|
73
|
+
* a defence-in-depth check the audit ledger can use before persisting.
|
|
74
|
+
*/
|
|
75
|
+
export declare const looksLikeBrowserSafeSourceEnvelope: (envelope: QualityIntelligenceSourceEnvelope) => boolean;
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=sourceEnvelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceEnvelope.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/sourceEnvelope.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AAEpE,MAAM,MAAM,6BAA6B,GACrC,oBAAoB,GACpB,yBAAyB,GACzB,gBAAgB,GAChB,eAAe,GACf,oBAAoB,CAAC;AAEzB,eAAO,MAAM,iCAAiC,EAAE,SAAS,6BAA6B,EAM5E,CAAC;AAEX,MAAM,WAAW,mCAAmC;IAClD,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;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