jingu-protocol 0.1.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/README.md +162 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/rpp/rpp.failures.d.ts +9 -0
- package/dist/src/rpp/rpp.failures.d.ts.map +1 -0
- package/dist/src/rpp/rpp.failures.js +77 -0
- package/dist/src/rpp/rpp.failures.js.map +1 -0
- package/dist/src/rpp/rpp.types.d.ts +47 -0
- package/dist/src/rpp/rpp.types.d.ts.map +1 -0
- package/dist/src/rpp/rpp.types.js +3 -0
- package/dist/src/rpp/rpp.types.js.map +1 -0
- package/dist/src/rpp/rpp.validate.d.ts +3 -0
- package/dist/src/rpp/rpp.validate.d.ts.map +1 -0
- package/dist/src/rpp/rpp.validate.js +186 -0
- package/dist/src/rpp/rpp.validate.js.map +1 -0
- package/package.json +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# jingu-protocol
|
|
2
|
+
|
|
3
|
+
Shared protocol types for the [Jingu](https://github.com/ylu999/jingu-core) system.
|
|
4
|
+
|
|
5
|
+
Contains the **Reasoning Provenance Protocol (RPP)** — a per-call cognitive audit contract that requires every AI reasoning step to be traceable to evidence, rules, or methods before any tool or action is allowed to execute.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Every claim an AI makes must be backed by a reference.
|
|
9
|
+
If you can't trace it, you can't trust it.
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## What is RPP?
|
|
15
|
+
|
|
16
|
+
RPP is a structured audit record that an AI agent must produce alongside any action it takes. It enforces four cognitive stages before execution:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
interpretation → reasoning → decision → action → response
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Each stage must:
|
|
23
|
+
- Have non-empty content
|
|
24
|
+
- Cite at least one reference (evidence, rule, or method)
|
|
25
|
+
- The decision stage must cite a rule or method (not just evidence)
|
|
26
|
+
- The response content must be traceable to prior step content
|
|
27
|
+
|
|
28
|
+
A `pre_tool_use` hook validates the RPP block before any tool runs. Missing or invalid RPP blocks the execution.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install jingu-protocol
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { validateRPP } from "jingu-protocol"
|
|
44
|
+
import type { RPPRecord } from "jingu-protocol"
|
|
45
|
+
|
|
46
|
+
const record: RPPRecord = {
|
|
47
|
+
call_id: "call-001",
|
|
48
|
+
steps: [
|
|
49
|
+
{
|
|
50
|
+
stage: "interpretation",
|
|
51
|
+
content: ["User wants to read file foo.ts"],
|
|
52
|
+
references: [{ type: "evidence", source: "user_input", locator: "message.current", supports: "user asked to read foo.ts" }],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
stage: "reasoning",
|
|
56
|
+
content: ["foo.ts likely contains the type definition we need"],
|
|
57
|
+
references: [{ type: "method", method_id: "DBG-001", supports: "read before write — inspect file before modifying" }],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
stage: "decision",
|
|
61
|
+
content: ["Read foo.ts to confirm type shape before editing"],
|
|
62
|
+
references: [{ type: "rule", rule_id: "RUL-002", supports: "cite evidence for every claim before acting" }],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
stage: "action",
|
|
66
|
+
content: ["Read foo.ts"],
|
|
67
|
+
references: [{ type: "evidence", source: "file", locator: "src/foo.ts", supports: "target file for the read action" }],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
response: {
|
|
71
|
+
content: ["Read foo.ts to confirm type shape"],
|
|
72
|
+
references: [{ type: "derived", supports: "action step states: read foo.ts" }],
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const result = validateRPP(record)
|
|
77
|
+
// result.overall_status: "valid" | "weakly_supported" | "invalid"
|
|
78
|
+
// result.failures: RPPFailure[] — hard failures (block execution)
|
|
79
|
+
// result.warnings: RPPFailure[] — soft failures (flagged but allowed)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Validation rules
|
|
85
|
+
|
|
86
|
+
### Hard failures — block execution
|
|
87
|
+
|
|
88
|
+
| Code | What it catches |
|
|
89
|
+
|------|----------------|
|
|
90
|
+
| `MISSING_STAGE` | One of the 4 required stages (interpretation, reasoning, decision, action) is absent |
|
|
91
|
+
| `EMPTY_CONTENT` | A stage has no content entries |
|
|
92
|
+
| `NO_REFERENCES` | A stage has no references |
|
|
93
|
+
| `UNJUSTIFIED_DECISION` | Decision stage has only evidence refs — must have at least one rule or method |
|
|
94
|
+
| `UNTRACEABLE_RESPONSE` | Response content cannot be traced back to any prior step |
|
|
95
|
+
| `INVALID_REFERENCE` | A rule_id or method_id is malformed, or an evidence ref has empty source/locator |
|
|
96
|
+
|
|
97
|
+
### Soft failures — warnings only
|
|
98
|
+
|
|
99
|
+
| Code | What it catches |
|
|
100
|
+
|------|----------------|
|
|
101
|
+
| `SUPPORTS_TOO_VAGUE` | A reference's `supports` field is under 10 characters |
|
|
102
|
+
| `INFERENCE_AS_FACT` | Reasoning stage uses certainty language without an evidence reference |
|
|
103
|
+
| `METHOD_NOT_ACTUALLY_USED` | A method_id is cited but the method's logic is not reflected in the content |
|
|
104
|
+
| `CIRCULAR_REFERENCE` | Two references mutually cite each other with no external grounding |
|
|
105
|
+
| `ACTION_SCOPE_VIOLATION` | Action proposes more than what the decision stage authorized |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Reference types
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
type EvidenceRef = {
|
|
113
|
+
type: "evidence"
|
|
114
|
+
source: string // "user_input" | "file" | "log" | "test_output" | "tool_result"
|
|
115
|
+
locator: string // file path with optional :line, log line range, etc.
|
|
116
|
+
supports: string // which specific claim this evidence supports
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
type RuleRef = {
|
|
120
|
+
type: "rule"
|
|
121
|
+
rule_id: string // must match /^[A-Z]+-\d+$/ — e.g. "RUL-001"
|
|
122
|
+
supports: string
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
type MethodRef = {
|
|
126
|
+
type: "method"
|
|
127
|
+
method_id: string // must match /^[A-Z]+-\d+$/ — e.g. "RCA-001"
|
|
128
|
+
supports: string
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Exports
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
// Types
|
|
138
|
+
export type { RPPRecord, RPPFailure, RPPFailureCode, RPPValidationResult }
|
|
139
|
+
export type { EvidenceRef, RuleRef, MethodRef, Reference }
|
|
140
|
+
export type { CognitiveStep, ResponseStep }
|
|
141
|
+
export type { RPPFailureDescription }
|
|
142
|
+
|
|
143
|
+
// Functions
|
|
144
|
+
export { validateRPP }
|
|
145
|
+
export { isHardFailure }
|
|
146
|
+
export { RPP_FAILURE_DESCRIPTIONS }
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Who uses this
|
|
152
|
+
|
|
153
|
+
| Package | Role |
|
|
154
|
+
|---------|------|
|
|
155
|
+
| [`jingu-trust-gate`](https://github.com/ylu999/jingu-trust-gate) | Runs `validateRPP` as a `pre_tool_use` hook — blocks tool execution if RPP is missing or invalid |
|
|
156
|
+
| [`jingu-policy-core`](https://github.com/ylu999/jingu-policy-core) | Re-exports all RPP types for consumers that import from `jingu-policy-core` |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
MIT
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { EvidenceRef, RuleRef, MethodRef, Reference, CognitiveStep, ResponseStep, RPPRecord, RPPFailureCode, RPPFailure, RPPValidationResult, } from "./rpp/rpp.types.js";
|
|
2
|
+
export type { RPPFailureDescription } from "./rpp/rpp.failures.js";
|
|
3
|
+
export { RPP_FAILURE_DESCRIPTIONS, isHardFailure } from "./rpp/rpp.failures.js";
|
|
4
|
+
export { validateRPP } from "./rpp/rpp.validate.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,WAAW,EACX,OAAO,EACP,SAAS,EACT,SAAS,EACT,aAAa,EACb,YAAY,EACZ,SAAS,EACT,cAAc,EACd,UAAU,EACV,mBAAmB,GACpB,MAAM,oBAAoB,CAAA;AAE3B,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE/E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAgB3C,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE/E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RPPFailureCode } from "./rpp.types.js";
|
|
2
|
+
export type RPPFailureDescription = {
|
|
3
|
+
severity: "error" | "warning";
|
|
4
|
+
description: string;
|
|
5
|
+
example: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const RPP_FAILURE_DESCRIPTIONS: Record<RPPFailureCode, RPPFailureDescription>;
|
|
8
|
+
export declare function isHardFailure(code: RPPFailureCode): boolean;
|
|
9
|
+
//# sourceMappingURL=rpp.failures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpp.failures.d.ts","sourceRoot":"","sources":["../../../src/rpp/rpp.failures.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,cAAc,EAAE,qBAAqB,CAgElF,CAAA;AAWD,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAE3D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// src/rpp/rpp.failures.ts
|
|
2
|
+
export const RPP_FAILURE_DESCRIPTIONS = {
|
|
3
|
+
// Hard failures (severity: "error") — block execution
|
|
4
|
+
MISSING_STAGE: {
|
|
5
|
+
severity: "error",
|
|
6
|
+
description: "A required cognitive stage (interpretation, reasoning, decision, or action) is absent from the RPP record.",
|
|
7
|
+
example: "RPP record has steps for interpretation and decision but omits the reasoning stage entirely.",
|
|
8
|
+
},
|
|
9
|
+
EMPTY_CONTENT: {
|
|
10
|
+
severity: "error",
|
|
11
|
+
description: "A stage or response step has an empty content array or all content entries are blank strings.",
|
|
12
|
+
example: "The decision stage has content: [] with no entries explaining what was decided.",
|
|
13
|
+
},
|
|
14
|
+
NO_REFERENCES: {
|
|
15
|
+
severity: "error",
|
|
16
|
+
description: "A stage or response step that requires references has none, making the output ungrounded.",
|
|
17
|
+
example: "The response step cites no evidence or rules despite making factual claims.",
|
|
18
|
+
},
|
|
19
|
+
UNTRACEABLE_RESPONSE: {
|
|
20
|
+
severity: "error",
|
|
21
|
+
description: "The final response cannot be traced back to any step in the cognitive chain — no references link response to prior reasoning.",
|
|
22
|
+
example: "Response says 'use method X' but no reasoning or decision step mentions method X.",
|
|
23
|
+
},
|
|
24
|
+
UNJUSTIFIED_DECISION: {
|
|
25
|
+
severity: "error",
|
|
26
|
+
description: "A decision stage has no supporting rule or evidence reference to justify why this decision was made.",
|
|
27
|
+
example: "Decision stage selects option B but provides no rule_id or evidence reference explaining the choice.",
|
|
28
|
+
},
|
|
29
|
+
INVALID_REFERENCE: {
|
|
30
|
+
severity: "error",
|
|
31
|
+
description: "A reference is structurally malformed or points to a non-existent source, rule, or method.",
|
|
32
|
+
example: "A RuleRef has rule_id: '' (empty string) or an EvidenceRef has a locator that does not match any known document.",
|
|
33
|
+
},
|
|
34
|
+
// Soft failures (severity: "warning") — flagged but do not block
|
|
35
|
+
UNSUPPORTED_CLAIM: {
|
|
36
|
+
severity: "warning",
|
|
37
|
+
description: "A content entry makes a factual claim that has no corresponding reference supporting it.",
|
|
38
|
+
example: "Reasoning stage states 'This pattern is always inefficient' but no evidence reference backs that claim.",
|
|
39
|
+
},
|
|
40
|
+
INFERENCE_AS_FACT: {
|
|
41
|
+
severity: "warning",
|
|
42
|
+
description: "An inference or assumption is stated as established fact without acknowledging uncertainty.",
|
|
43
|
+
example: "Content says 'The user intends to deploy to production' without marking it as an inference or listing it in uncertainties.",
|
|
44
|
+
},
|
|
45
|
+
SUPPORTS_TOO_VAGUE: {
|
|
46
|
+
severity: "warning",
|
|
47
|
+
description: "A reference's 'supports' field is too generic to meaningfully trace which claim it backs.",
|
|
48
|
+
example: "EvidenceRef has supports: 'general context' instead of specifying which particular claim it supports.",
|
|
49
|
+
},
|
|
50
|
+
METHOD_NOT_ACTUALLY_USED: {
|
|
51
|
+
severity: "warning",
|
|
52
|
+
description: "A method_ref is declared in a stage but the method's logic is not reflected in the stage's content.",
|
|
53
|
+
example: "Stage declares method_ref for 'cost-benefit-analysis' but the content shows no cost or benefit comparison.",
|
|
54
|
+
},
|
|
55
|
+
CIRCULAR_REFERENCE: {
|
|
56
|
+
severity: "warning",
|
|
57
|
+
description: "Two or more references form a cycle where each claims to support the other with no external grounding.",
|
|
58
|
+
example: "Step A references step B as evidence, and step B references step A as its justification.",
|
|
59
|
+
},
|
|
60
|
+
ACTION_SCOPE_VIOLATION: {
|
|
61
|
+
severity: "warning",
|
|
62
|
+
description: "An action step proposes actions that exceed the scope authorized by the preceding decision stage.",
|
|
63
|
+
example: "Decision stage authorizes 'update config file' but action stage also proposes 'delete the database'.",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
const HARD_FAILURE_CODES = new Set([
|
|
67
|
+
"MISSING_STAGE",
|
|
68
|
+
"EMPTY_CONTENT",
|
|
69
|
+
"NO_REFERENCES",
|
|
70
|
+
"UNTRACEABLE_RESPONSE",
|
|
71
|
+
"UNJUSTIFIED_DECISION",
|
|
72
|
+
"INVALID_REFERENCE",
|
|
73
|
+
]);
|
|
74
|
+
export function isHardFailure(code) {
|
|
75
|
+
return HARD_FAILURE_CODES.has(code);
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=rpp.failures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpp.failures.js","sourceRoot":"","sources":["../../../src/rpp/rpp.failures.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAU1B,MAAM,CAAC,MAAM,wBAAwB,GAAkD;IACrF,sDAAsD;IACtD,aAAa,EAAE;QACb,QAAQ,EAAE,OAAO;QACjB,WAAW,EAAE,4GAA4G;QACzH,OAAO,EAAE,8FAA8F;KACxG;IACD,aAAa,EAAE;QACb,QAAQ,EAAE,OAAO;QACjB,WAAW,EAAE,+FAA+F;QAC5G,OAAO,EAAE,iFAAiF;KAC3F;IACD,aAAa,EAAE;QACb,QAAQ,EAAE,OAAO;QACjB,WAAW,EAAE,2FAA2F;QACxG,OAAO,EAAE,6EAA6E;KACvF;I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
|
|
1
|
+
export type EvidenceRef = {
|
|
2
|
+
type: "evidence";
|
|
3
|
+
source: string;
|
|
4
|
+
locator: string;
|
|
5
|
+
supports: string;
|
|
6
|
+
};
|
|
7
|
+
export type RuleRef = {
|
|
8
|
+
type: "rule";
|
|
9
|
+
rule_id: string;
|
|
10
|
+
supports: string;
|
|
11
|
+
};
|
|
12
|
+
export type MethodRef = {
|
|
13
|
+
type: "method";
|
|
14
|
+
method_id: string;
|
|
15
|
+
supports: string;
|
|
16
|
+
};
|
|
17
|
+
export type Reference = EvidenceRef | RuleRef | MethodRef;
|
|
18
|
+
export type CognitiveStep = {
|
|
19
|
+
stage: "interpretation" | "reasoning" | "decision" | "action";
|
|
20
|
+
content: string[];
|
|
21
|
+
references: Reference[];
|
|
22
|
+
method_refs?: MethodRef[];
|
|
23
|
+
uncertainties?: string[];
|
|
24
|
+
};
|
|
25
|
+
export type ResponseStep = {
|
|
26
|
+
content: string[];
|
|
27
|
+
references: Reference[];
|
|
28
|
+
};
|
|
29
|
+
export type RPPRecord = {
|
|
30
|
+
call_id: string;
|
|
31
|
+
session_id?: string;
|
|
32
|
+
call_sequence?: number;
|
|
33
|
+
steps: CognitiveStep[];
|
|
34
|
+
response: ResponseStep;
|
|
35
|
+
};
|
|
36
|
+
export type RPPFailureCode = "MISSING_STAGE" | "EMPTY_CONTENT" | "NO_REFERENCES" | "UNSUPPORTED_CLAIM" | "INFERENCE_AS_FACT" | "UNTRACEABLE_RESPONSE" | "UNJUSTIFIED_DECISION" | "ACTION_SCOPE_VIOLATION" | "METHOD_NOT_ACTUALLY_USED" | "INVALID_REFERENCE" | "SUPPORTS_TOO_VAGUE" | "CIRCULAR_REFERENCE";
|
|
37
|
+
export type RPPFailure = {
|
|
38
|
+
code: RPPFailureCode;
|
|
39
|
+
stage?: CognitiveStep["stage"] | "response";
|
|
40
|
+
detail: string;
|
|
41
|
+
};
|
|
42
|
+
export type RPPValidationResult = {
|
|
43
|
+
overall_status: "valid" | "weakly_supported" | "invalid";
|
|
44
|
+
failures: RPPFailure[];
|
|
45
|
+
warnings: RPPFailure[];
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=rpp.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpp.types.d.ts","sourceRoot":"","sources":["../../../src/rpp/rpp.types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAA;AAEzD,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,gBAAgB,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAA;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,SAAS,EAAE,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,aAAa,EAAE,CAAA;IACtB,QAAQ,EAAE,YAAY,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,cAAc,GACtB,eAAe,GACf,eAAe,GACf,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,sBAAsB,GACtB,sBAAsB,GACtB,wBAAwB,GACxB,0BAA0B,GAC1B,mBAAmB,GACnB,oBAAoB,GACpB,oBAAoB,CAAA;AAExB,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,cAAc,CAAA;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,UAAU,CAAA;IAC3C,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAAA;IACxD,QAAQ,EAAE,UAAU,EAAE,CAAA;IACtB,QAAQ,EAAE,UAAU,EAAE,CAAA;CACvB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpp.types.js","sourceRoot":"","sources":["../../../src/rpp/rpp.types.ts"],"names":[],"mappings":"AAAA,uBAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpp.validate.d.ts","sourceRoot":"","sources":["../../../src/rpp/rpp.validate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAc,mBAAmB,EAA4B,MAAM,gBAAgB,CAAA;AAuErG,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,mBAAmB,CAkIlE"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
// src/rpp/rpp.validate.ts
|
|
2
|
+
import { isHardFailure } from "./rpp.failures.js";
|
|
3
|
+
const REQUIRED_STAGES = [
|
|
4
|
+
"interpretation",
|
|
5
|
+
"reasoning",
|
|
6
|
+
"decision",
|
|
7
|
+
"action",
|
|
8
|
+
];
|
|
9
|
+
const RULE_METHOD_ID_PATTERN = /^[A-Z]+-\d+$/;
|
|
10
|
+
const CERTAINTY_WORDS = [
|
|
11
|
+
"is definitely",
|
|
12
|
+
"always",
|
|
13
|
+
"never",
|
|
14
|
+
"must be",
|
|
15
|
+
"certainly",
|
|
16
|
+
];
|
|
17
|
+
function validateReference(ref, stage) {
|
|
18
|
+
if (ref.type === "rule") {
|
|
19
|
+
if (!RULE_METHOD_ID_PATTERN.test(ref.rule_id)) {
|
|
20
|
+
return {
|
|
21
|
+
code: "INVALID_REFERENCE",
|
|
22
|
+
stage,
|
|
23
|
+
detail: `RuleRef has invalid rule_id: "${ref.rule_id}". Must match /^[A-Z]+-\\d+$/.`,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else if (ref.type === "method") {
|
|
28
|
+
if (!RULE_METHOD_ID_PATTERN.test(ref.method_id)) {
|
|
29
|
+
return {
|
|
30
|
+
code: "INVALID_REFERENCE",
|
|
31
|
+
stage,
|
|
32
|
+
detail: `MethodRef has invalid method_id: "${ref.method_id}". Must match /^[A-Z]+-\\d+$/.`,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else if (ref.type === "evidence") {
|
|
37
|
+
if (!ref.source || typeof ref.source !== "string" || ref.source.trim() === "") {
|
|
38
|
+
return {
|
|
39
|
+
code: "INVALID_REFERENCE",
|
|
40
|
+
stage,
|
|
41
|
+
detail: `EvidenceRef has empty or missing 'source' field.`,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (!ref.locator || typeof ref.locator !== "string" || ref.locator.trim() === "") {
|
|
45
|
+
return {
|
|
46
|
+
code: "INVALID_REFERENCE",
|
|
47
|
+
stage,
|
|
48
|
+
detail: `EvidenceRef has empty or missing 'locator' field.`,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Extract the first noun phrase from a string (min 3 chars).
|
|
56
|
+
* Simple heuristic: take the first word of length >= 3.
|
|
57
|
+
*/
|
|
58
|
+
function extractFirstKeyPhrase(text) {
|
|
59
|
+
const words = text.split(/\s+/);
|
|
60
|
+
for (const word of words) {
|
|
61
|
+
const cleaned = word.replace(/[^a-zA-Z0-9]/g, "");
|
|
62
|
+
if (cleaned.length >= 3) {
|
|
63
|
+
return cleaned.toLowerCase();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
export function validateRPP(record) {
|
|
69
|
+
const allIssues = [];
|
|
70
|
+
// --- Check 1: MISSING_STAGE ---
|
|
71
|
+
const presentStages = new Set(record.steps.map((s) => s.stage));
|
|
72
|
+
for (const required of REQUIRED_STAGES) {
|
|
73
|
+
if (!presentStages.has(required)) {
|
|
74
|
+
allIssues.push({
|
|
75
|
+
code: "MISSING_STAGE",
|
|
76
|
+
stage: required,
|
|
77
|
+
detail: `Required stage "${required}" is missing from the RPP record.`,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// For checks 2–7, iterate over present steps only
|
|
82
|
+
for (const step of record.steps) {
|
|
83
|
+
const stage = step.stage;
|
|
84
|
+
// --- Check 2: EMPTY_CONTENT ---
|
|
85
|
+
if (!step.content || step.content.length < 1) {
|
|
86
|
+
allIssues.push({
|
|
87
|
+
code: "EMPTY_CONTENT",
|
|
88
|
+
stage,
|
|
89
|
+
detail: `Stage "${stage}" has empty content array.`,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// --- Check 3: NO_REFERENCES ---
|
|
93
|
+
if (!step.references || step.references.length < 1) {
|
|
94
|
+
allIssues.push({
|
|
95
|
+
code: "NO_REFERENCES",
|
|
96
|
+
stage,
|
|
97
|
+
detail: `Stage "${stage}" has no references.`,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
// --- Check 4: SUPPORTS_TOO_VAGUE (warning) ---
|
|
101
|
+
for (const ref of step.references ?? []) {
|
|
102
|
+
if (ref.supports.length < 10) {
|
|
103
|
+
allIssues.push({
|
|
104
|
+
code: "SUPPORTS_TOO_VAGUE",
|
|
105
|
+
stage,
|
|
106
|
+
detail: `Reference in stage "${stage}" has a 'supports' field that is too vague: "${ref.supports}".`,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// --- Check 5: INVALID_REFERENCE ---
|
|
111
|
+
for (const ref of step.references ?? []) {
|
|
112
|
+
const failure = validateReference(ref, stage);
|
|
113
|
+
if (failure) {
|
|
114
|
+
allIssues.push(failure);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// --- Check 6: UNJUSTIFIED_DECISION ---
|
|
119
|
+
const decisionStep = record.steps.find((s) => s.stage === "decision");
|
|
120
|
+
if (decisionStep) {
|
|
121
|
+
const hasRuleOrMethod = decisionStep.references.some((ref) => ref.type === "rule" || ref.type === "method");
|
|
122
|
+
if (!hasRuleOrMethod) {
|
|
123
|
+
allIssues.push({
|
|
124
|
+
code: "UNJUSTIFIED_DECISION",
|
|
125
|
+
stage: "decision",
|
|
126
|
+
detail: `Decision stage has no rule or method reference to justify the decision.`,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// --- Check 7: INFERENCE_AS_FACT (warning) ---
|
|
131
|
+
const reasoningStep = record.steps.find((s) => s.stage === "reasoning");
|
|
132
|
+
if (reasoningStep) {
|
|
133
|
+
const hasEvidenceRef = reasoningStep.references.some((ref) => ref.type === "evidence");
|
|
134
|
+
if (!hasEvidenceRef) {
|
|
135
|
+
for (const contentItem of reasoningStep.content ?? []) {
|
|
136
|
+
const lower = contentItem.toLowerCase();
|
|
137
|
+
const hasCertaintyWord = CERTAINTY_WORDS.some((word) => lower.includes(word));
|
|
138
|
+
if (hasCertaintyWord) {
|
|
139
|
+
allIssues.push({
|
|
140
|
+
code: "INFERENCE_AS_FACT",
|
|
141
|
+
stage: "reasoning",
|
|
142
|
+
detail: `Reasoning stage content uses certainty language ("${CERTAINTY_WORDS.find((w) => lower.includes(w))}") without any evidence reference: "${contentItem.slice(0, 80)}${contentItem.length > 80 ? "..." : ""}"`,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// --- Check 8: UNTRACEABLE_RESPONSE ---
|
|
149
|
+
// Gather all prior step content strings
|
|
150
|
+
const allPriorContent = record.steps.flatMap((s) => s.content ?? []).map((c) => c.toLowerCase());
|
|
151
|
+
if (record.response.content.length > 0) {
|
|
152
|
+
let anyTraced = false;
|
|
153
|
+
for (const responseItem of record.response.content) {
|
|
154
|
+
const keyPhrase = extractFirstKeyPhrase(responseItem);
|
|
155
|
+
if (keyPhrase !== null) {
|
|
156
|
+
const traced = allPriorContent.some((priorContent) => priorContent.includes(keyPhrase));
|
|
157
|
+
if (traced) {
|
|
158
|
+
anyTraced = true;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (!anyTraced) {
|
|
164
|
+
allIssues.push({
|
|
165
|
+
code: "UNTRACEABLE_RESPONSE",
|
|
166
|
+
stage: "response",
|
|
167
|
+
detail: `None of the response content items could be traced back to any prior step's content.`,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// --- Compute overall_status ---
|
|
172
|
+
const failures = allIssues.filter((issue) => isHardFailure(issue.code));
|
|
173
|
+
const warnings = allIssues.filter((issue) => !isHardFailure(issue.code));
|
|
174
|
+
let overall_status;
|
|
175
|
+
if (failures.length > 0) {
|
|
176
|
+
overall_status = "invalid";
|
|
177
|
+
}
|
|
178
|
+
else if (warnings.length > 0) {
|
|
179
|
+
overall_status = "weakly_supported";
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
overall_status = "valid";
|
|
183
|
+
}
|
|
184
|
+
return { overall_status, failures, warnings };
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=rpp.validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpp.validate.js","sourceRoot":"","sources":["../../../src/rpp/rpp.validate.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAG1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,eAAe,GAAkC;IACrD,gBAAgB;IAChB,WAAW;IACX,UAAU;IACV,QAAQ;CACT,CAAA;AAED,MAAM,sBAAsB,GAAG,cAAc,CAAA;AAE7C,MAAM,eAAe,GAAG;IACtB,eAAe;IACf,QAAQ;IACR,OAAO;IACP,SAAS;IACT,WAAW;CACZ,CAAA;AAED,SAAS,iBAAiB,CAAC,GAAc,EAAE,KAA0C;IACnF,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACxB,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9C,OAAO;gBACL,IAAI,EAAE,mBAAmB;gBACzB,KAAK;gBACL,MAAM,EAAE,iCAAiC,GAAG,CAAC,OAAO,gCAAgC;aACrF,CAAA;QACH,CAAC;IACH,CAAC;SAAM,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAChD,OAAO;gBACL,IAAI,EAAE,mBAAmB;gBACzB,KAAK;gBACL,MAAM,EAAE,qCAAqC,GAAG,CAAC,SAAS,gCAAgC;aAC3F,CAAA;QACH,CAAC;IACH,CAAC;SAAM,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC9E,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AC;gBACb,IAAI,EAAE,sBAAsB;gBAC5B,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,sFAAsF;aAC/F,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,iCAAiC;IACjC,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IACvE,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAExE,IAAI,cAAqD,CAAA;IACzD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,cAAc,GAAG,SAAS,CAAA;IAC5B,CAAC;SAAM,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,cAAc,GAAG,kBAAkB,CAAA;IACrC,CAAC;SAAM,CAAC;QACN,cAAc,GAAG,OAAO,CAAA;IAC1B,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;AAC/C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jingu-protocol",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared protocol types for the Jingu system — RPP (Reasoning Provenance Protocol) and related definitions",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/src/index.js",
|
|
7
|
+
"types": "./dist/src/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": "./dist/src/index.js",
|
|
11
|
+
"import": "./dist/src/index.js",
|
|
12
|
+
"types": "./dist/src/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/src"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.json",
|
|
20
|
+
"test": "node --test dist/src/**/*.test.js"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.4.0"
|
|
24
|
+
}
|
|
25
|
+
}
|