@intentius/chant-lexicon-cedar 0.44.9 → 0.44.12
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 +48 -2
- package/dist/agentcore/embed.d.ts +189 -0
- package/dist/agentcore/embed.d.ts.map +1 -0
- package/dist/agentcore/enforcement.d.ts +76 -0
- package/dist/agentcore/enforcement.d.ts.map +1 -0
- package/dist/agentcore/scan.d.ts +46 -0
- package/dist/agentcore/scan.d.ts.map +1 -0
- package/dist/avp/client.d.ts +85 -8
- package/dist/avp/client.d.ts.map +1 -1
- package/dist/codegen/docs-dogwood.d.ts +21 -0
- package/dist/codegen/docs-dogwood.d.ts.map +1 -0
- package/dist/codegen/docs.d.ts.map +1 -1
- package/dist/dogwood/cli.d.ts +41 -0
- package/dist/dogwood/cli.d.ts.map +1 -1
- package/dist/dogwood/index.d.ts +10 -4
- package/dist/dogwood/index.d.ts.map +1 -1
- package/dist/dogwood/replay-activity.d.ts +196 -0
- package/dist/dogwood/replay-activity.d.ts.map +1 -0
- package/dist/dogwood/replay-op.d.ts +165 -0
- package/dist/dogwood/replay-op.d.ts.map +1 -0
- package/dist/dogwood/serialize.d.ts +20 -0
- package/dist/dogwood/serialize.d.ts.map +1 -1
- package/dist/dogwood/trace.d.ts +215 -0
- package/dist/dogwood/trace.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +5 -3
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/post-synth/dwdc013.d.ts +33 -0
- package/dist/lint/post-synth/dwdc013.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/okf/index.md +1 -0
- package/dist/okf/rules/DWDC013.md +15 -0
- package/dist/okf/types/Policy.md +1 -0
- package/dist/op/activities/index.d.ts +18 -0
- package/dist/op/activities/index.d.ts.map +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/rules/dwdc013.ts +64 -0
- package/dist/skills/chant-cedar-dogwood.md +327 -0
- package/package.json +7 -2
- package/src/agentcore/embed.test.ts +254 -0
- package/src/agentcore/embed.ts +399 -0
- package/src/agentcore/enforcement.test.ts +43 -0
- package/src/agentcore/enforcement.ts +92 -0
- package/src/agentcore/scan.ts +119 -0
- package/src/avp/OWNERSHIP.md +38 -0
- package/src/avp/client.test.ts +271 -0
- package/src/avp/client.ts +150 -16
- package/src/codegen/docs-dogwood.ts +1119 -0
- package/src/codegen/docs.ts +66 -1
- package/src/dogwood/cli.test.ts +122 -1
- package/src/dogwood/cli.ts +122 -1
- package/src/dogwood/index.ts +74 -1
- package/src/dogwood/replay-activity.test.ts +481 -0
- package/src/dogwood/replay-activity.ts +506 -0
- package/src/dogwood/replay-op.ts +242 -0
- package/src/dogwood/serialize.ts +37 -0
- package/src/dogwood/trace.test.ts +231 -0
- package/src/dogwood/trace.ts +471 -0
- package/src/index.ts +52 -0
- package/src/lint/audit-catalog.ts +8 -0
- package/src/lint/post-synth/dwd-post-synth.test.ts +119 -1
- package/src/lint/post-synth/dwdc013.ts +64 -0
- package/src/lint/post-synth/dwde-post-synth.test.ts +1 -1
- package/src/lint/post-synth/index.ts +2 -0
- package/src/op/activities/index.ts +27 -0
- package/src/plugin.test.ts +3 -2
- package/src/plugin.ts +30 -0
- package/src/skills/chant-cedar-dogwood.md +327 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-op.d.ts","sourceRoot":"","sources":["../../src/dogwood/replay-op.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,EAA8B,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,2DAA2D;AAC3D,eAAO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C,MAAM,WAAW,oBAAoB;IACnC,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAE7B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,uFAAuF;IACvF,SAAS,EAAE,MAAM,CAAC;IAElB,gFAAgF;IAChF,MAAM,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAEtC,uDAAuD;IACvD,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,4FAA4F;IAC5F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,8CAA8C;AAC9C,MAAM,WAAW,uBAAuB;IACtC,2EAA2E;IAC3E,EAAE,EAAE,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;CACrC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,uBAAuB,CAyDpF"}
|
|
@@ -43,4 +43,24 @@ export declare function renderTemporalPolicyText(id: string, props: Record<strin
|
|
|
43
43
|
* a policy's `@id` does not depend on which leg rendered it.
|
|
44
44
|
*/
|
|
45
45
|
export declare function serializeDogwood(entities: Map<string, Declarable>): DogwoodSerializeResult | undefined;
|
|
46
|
+
/** One declared temporal policy, resolved: chant name, policy id, walked props. */
|
|
47
|
+
export interface DogwoodPolicyRecord {
|
|
48
|
+
/** The chant entity name — the export name on the `*.ts` file. */
|
|
49
|
+
name: string;
|
|
50
|
+
/** The policy id, as it appears in `@id(…)`. */
|
|
51
|
+
id: string;
|
|
52
|
+
/** Props with references resolved, ready for `renderTemporalPolicyText`. */
|
|
53
|
+
props: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Every `Dogwood::TemporalPolicy` in a build, with references walked and ids
|
|
57
|
+
* resolved — the temporal counterpart of `cedarPolicyRecords` (#1660).
|
|
58
|
+
*
|
|
59
|
+
* `serializeDogwood` above renders whole *files*; the AgentCore embedding needs
|
|
60
|
+
* the policies one at a time, because `AWS::BedrockAgentCore::Policy` carries a
|
|
61
|
+
* single statement and `EnforcementMode` is set per policy. Both paths walk
|
|
62
|
+
* references through the same visitor, so a scope that names another declared
|
|
63
|
+
* entity resolves identically whichever one rendered it.
|
|
64
|
+
*/
|
|
65
|
+
export declare function dogwoodPolicyRecords(entities: Map<string, Declarable>): DogwoodPolicyRecord[];
|
|
46
66
|
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/dogwood/serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAgB9D,sDAAsD;AACtD,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAE3C,kDAAkD;AAClD,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD,yFAAyF;AACzF,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ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;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,mBAAmB,EAAE,CAe7F"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed construction of dogwood replay traces (#1661, epic #1646).
|
|
3
|
+
*
|
|
4
|
+
* A trace is one event per line, and the line grammar recorded by the #1657
|
|
5
|
+
* verification (§6, read from `dogwood-language/src/interpreter/log_parse.rs`
|
|
6
|
+
* at the pinned SHA) is:
|
|
7
|
+
*
|
|
8
|
+
* ```
|
|
9
|
+
* @<timestamp> [scope(principal: <uid>, resource: <uid>)]
|
|
10
|
+
* [entities(<uid>: { <attrs> } [in [<uid>, …]], …)]
|
|
11
|
+
* [request_context(<group>: { … }, …)]
|
|
12
|
+
* <Ns>::Action::"<Name>"::<kind>(<field>: <value>, …)
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* The three envelopes are optional and must appear in that order; the trailing
|
|
16
|
+
* group is the logged record. There is no comment syntax — a `//` is an
|
|
17
|
+
* ordinary part of a value, so URLs survive — blank lines are skipped, and a
|
|
18
|
+
* leading BOM is stripped.
|
|
19
|
+
*
|
|
20
|
+
* Two things in that format silently weaken a replay rather than failing it,
|
|
21
|
+
* and both are what this module exists to make hard:
|
|
22
|
+
*
|
|
23
|
+
* 1. **`request_context(…)` and the logged record are different bags.** The
|
|
24
|
+
* Cedar request is built from the first; temporal predicates match against
|
|
25
|
+
* the second. A field needed by both and supplied to only one weakens
|
|
26
|
+
* either the Cedar check or the temporal check, and the replay still exits
|
|
27
|
+
* 0 with a verdict that looks authoritative. So {@link traceEvent} writes a
|
|
28
|
+
* `context` group into *both* bags by default, and dropping one is an
|
|
29
|
+
* explicit per-event `bags` opt-out that has to be typed out.
|
|
30
|
+
* 2. **Actions must be fully qualified.** `Drupe::Action::"Transfer"`, never
|
|
31
|
+
* `Transfer` — a short name leaves the temporal predicate unmatched while
|
|
32
|
+
* Cedar still authorizes. {@link traceEvent} rejects anything that is not
|
|
33
|
+
* `Ns::…::"Name"` at construction.
|
|
34
|
+
*
|
|
35
|
+
* {@link auditTrace} is the same two checks applied to a trace this module did
|
|
36
|
+
* not build — the AgentCore session history #1661 leaves to the aws lexicon,
|
|
37
|
+
* or a `.log` recorded by hand. A trace is a trace, wherever it came from.
|
|
38
|
+
*/
|
|
39
|
+
/** `Ns::Type::"id"` in value position. */
|
|
40
|
+
export interface TraceEntityRef {
|
|
41
|
+
readonly traceValue: "entity";
|
|
42
|
+
readonly uid: string;
|
|
43
|
+
}
|
|
44
|
+
/** `1.50` — Cedar's decimal surface form, which a JS number cannot carry. */
|
|
45
|
+
export interface TraceDecimal {
|
|
46
|
+
readonly traceValue: "decimal";
|
|
47
|
+
readonly text: string;
|
|
48
|
+
}
|
|
49
|
+
/** Surface text passed through untouched — the escape hatch, used sparingly. */
|
|
50
|
+
export interface TraceRaw {
|
|
51
|
+
readonly traceValue: "raw";
|
|
52
|
+
readonly text: string;
|
|
53
|
+
}
|
|
54
|
+
/** A tagged value: one this module renders specially rather than by JS type. */
|
|
55
|
+
export type TraceTagged = TraceEntityRef | TraceDecimal | TraceRaw;
|
|
56
|
+
/** Anything that can sit in a trace field, in Cedar surface forms. */
|
|
57
|
+
export type TraceValue = string | number | boolean | TraceTagged | readonly TraceValue[] | {
|
|
58
|
+
readonly [key: string]: TraceValue;
|
|
59
|
+
};
|
|
60
|
+
/** A named group of fields — what one `request_context` envelope entry holds. */
|
|
61
|
+
export type TraceFields = {
|
|
62
|
+
readonly [key: string]: TraceValue;
|
|
63
|
+
};
|
|
64
|
+
/** `Ns::Type::"id"`. Validated at construction, so a short name cannot slip through. */
|
|
65
|
+
export declare function entityRef(uid: string): TraceEntityRef;
|
|
66
|
+
/** A Cedar decimal, written as it should appear (`"1.50"`). */
|
|
67
|
+
export declare function decimalValue(text: string): TraceDecimal;
|
|
68
|
+
/** Surface text, rendered verbatim. For values this module has no shape for. */
|
|
69
|
+
export declare function rawValue(text: string): TraceRaw;
|
|
70
|
+
/** Render one value in the Cedar surface form the trace parser reads. */
|
|
71
|
+
export declare function renderTraceValue(value: TraceValue): string;
|
|
72
|
+
/** `{ a: 1, b: "x" }` — a record body, braces included. */
|
|
73
|
+
export declare function renderTraceFields(fields: TraceFields): string;
|
|
74
|
+
/** The `scope(principal: …, resource: …)` envelope. Both are entity uids. */
|
|
75
|
+
export interface TraceScope {
|
|
76
|
+
readonly principal: string;
|
|
77
|
+
readonly resource: string;
|
|
78
|
+
}
|
|
79
|
+
/** One `entities(…)` entry: a uid, its attributes, and its parents. */
|
|
80
|
+
export interface TraceEntityDecl {
|
|
81
|
+
readonly uid: string;
|
|
82
|
+
readonly attrs?: TraceFields;
|
|
83
|
+
/** `in [<uid>, …]` — the entity's parents in the hierarchy. */
|
|
84
|
+
readonly parents?: readonly string[];
|
|
85
|
+
}
|
|
86
|
+
/** `Ns::Type::"id": { … } in [ … ]`. */
|
|
87
|
+
export declare function traceEntity(uid: string, attrs?: TraceFields, parents?: readonly string[]): TraceEntityDecl;
|
|
88
|
+
/**
|
|
89
|
+
* One trace line, fully resolved: every envelope decided, both bags settled.
|
|
90
|
+
*
|
|
91
|
+
* Built by {@link traceEvent} rather than by hand — the constructor is where
|
|
92
|
+
* the both-bags default and the qualified-action check live. The type stays
|
|
93
|
+
* public because a trace fetched from somewhere else (an AgentCore session
|
|
94
|
+
* history, a recorded `.log`) is normalized into it and then handed to
|
|
95
|
+
* {@link auditTrace}.
|
|
96
|
+
*/
|
|
97
|
+
export interface TraceEvent {
|
|
98
|
+
/** The `i64` after `@`. */
|
|
99
|
+
readonly timestamp: number;
|
|
100
|
+
/** Fully qualified: `Ns::Action::"Name"`. */
|
|
101
|
+
readonly action: string;
|
|
102
|
+
/** `request`, `response`, `error` conventionally — author-defined in truth. */
|
|
103
|
+
readonly kind: string;
|
|
104
|
+
/** The trailing logged record — what temporal predicates match against. */
|
|
105
|
+
readonly record: TraceFields;
|
|
106
|
+
/** The `request_context(…)` envelope — what the Cedar request is built from. */
|
|
107
|
+
readonly requestContext?: TraceFields;
|
|
108
|
+
readonly scope?: TraceScope;
|
|
109
|
+
readonly entities?: readonly TraceEntityDecl[];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Which bags a `context` group lands in.
|
|
113
|
+
*
|
|
114
|
+
* `both` is the default and the only one that keeps a replay honest. The other
|
|
115
|
+
* two exist so a test can *demonstrate* the weakening rather than only
|
|
116
|
+
* describe it, and so a trace that genuinely has no Cedar-side counterpart for
|
|
117
|
+
* a field can say so out loud instead of by omission.
|
|
118
|
+
*/
|
|
119
|
+
export type TraceBags = "both" | "record-only" | "context-only";
|
|
120
|
+
/** What {@link traceEvent} takes. */
|
|
121
|
+
export interface TraceEventInput {
|
|
122
|
+
readonly timestamp: number;
|
|
123
|
+
/** Fully qualified: `Ns::Action::"Name"`. A short name throws. */
|
|
124
|
+
readonly action: string;
|
|
125
|
+
/** Default `request` — the only kind the default event schema decides on. */
|
|
126
|
+
readonly kind?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Named field groups (`input`, `output`, …). Each lands in **both** the
|
|
129
|
+
* `request_context` envelope and the logged record unless {@link bags} says
|
|
130
|
+
* otherwise.
|
|
131
|
+
*/
|
|
132
|
+
readonly context?: {
|
|
133
|
+
readonly [group: string]: TraceFields;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Fields that belong to the logged record only — `callerPrincipal`,
|
|
137
|
+
* `callerResource`, `requestId`, `sessionId` and the rest of the event
|
|
138
|
+
* schema's own injections. These are never part of the Cedar request.
|
|
139
|
+
*/
|
|
140
|
+
readonly record?: TraceFields;
|
|
141
|
+
readonly scope?: TraceScope;
|
|
142
|
+
readonly entities?: readonly TraceEntityDecl[];
|
|
143
|
+
/** Explicit opt-out of both-bag population. See {@link TraceBags}. */
|
|
144
|
+
readonly bags?: TraceBags;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Build one trace event with both bags populated.
|
|
148
|
+
*
|
|
149
|
+
* Every `context` group is written to the `request_context` envelope *and*
|
|
150
|
+
* merged into the logged record, because that is the only combination in which
|
|
151
|
+
* the Cedar check and the temporal check both see the field. Dropping one is a
|
|
152
|
+
* typed decision (`bags`), not an omission.
|
|
153
|
+
*/
|
|
154
|
+
export declare function traceEvent(input: TraceEventInput): TraceEvent;
|
|
155
|
+
/** One event as the single line the trace parser reads. Never ends in a newline. */
|
|
156
|
+
export declare function renderTraceLine(event: TraceEvent): string;
|
|
157
|
+
/** A whole trace, one event per line, newline-terminated. */
|
|
158
|
+
export declare function renderTrace(events: readonly TraceEvent[]): string;
|
|
159
|
+
/** What {@link auditTrace} can find. */
|
|
160
|
+
export type TraceIssueKind = "single-bag" | "no-request-context" | "empty-record" | "out-of-order";
|
|
161
|
+
/** One finding against a trace, indexed by its position in the event list. */
|
|
162
|
+
export interface TraceIssue {
|
|
163
|
+
readonly kind: TraceIssueKind;
|
|
164
|
+
/** 0-based position in the event list — a trace has no line numbers of its own. */
|
|
165
|
+
readonly index: number;
|
|
166
|
+
readonly timestamp: number;
|
|
167
|
+
readonly message: string;
|
|
168
|
+
}
|
|
169
|
+
/** Options for {@link auditTrace} and {@link traceFixture}. */
|
|
170
|
+
export interface TraceAuditOptions {
|
|
171
|
+
/**
|
|
172
|
+
* Event kinds that produce a decision, and so build a Cedar request.
|
|
173
|
+
*
|
|
174
|
+
* Default `["request"]`, which is the convention the default event schema
|
|
175
|
+
* follows — the truth is whichever kinds the project's `.dwschema` marks
|
|
176
|
+
* `decision`, and that file is not visible from here. A history-only event
|
|
177
|
+
* never becomes a Cedar request, so an absent `request_context` on one is
|
|
178
|
+
* not a weakening and is not reported.
|
|
179
|
+
*/
|
|
180
|
+
readonly decisionKinds?: readonly string[];
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The both-bags and ordering checks, applied to any trace.
|
|
184
|
+
*
|
|
185
|
+
* Every finding here is something that makes a replay *weaker* rather than
|
|
186
|
+
* something that makes it fail — which is exactly the class a green replay run
|
|
187
|
+
* hides. A trace built by {@link traceEvent} produces none of them unless a
|
|
188
|
+
* `bags` opt-out was taken deliberately.
|
|
189
|
+
*/
|
|
190
|
+
export declare function auditTrace(events: readonly TraceEvent[], options?: TraceAuditOptions): TraceIssue[];
|
|
191
|
+
/** Options for {@link traceFixture}. */
|
|
192
|
+
export interface TraceFixtureOptions extends TraceAuditOptions {
|
|
193
|
+
/**
|
|
194
|
+
* Issue kinds to tolerate. Empty by default: a fixture that weakens its own
|
|
195
|
+
* replay throws at build time rather than producing a green run that proves
|
|
196
|
+
* nothing.
|
|
197
|
+
*/
|
|
198
|
+
readonly allow?: readonly TraceIssueKind[];
|
|
199
|
+
}
|
|
200
|
+
/** A built trace: the events, the text, and whatever the audit tolerated. */
|
|
201
|
+
export interface TraceFixture {
|
|
202
|
+
readonly events: readonly TraceEvent[];
|
|
203
|
+
readonly text: string;
|
|
204
|
+
readonly issues: readonly TraceIssue[];
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Assemble events into trace text, refusing to produce a weakened one.
|
|
208
|
+
*
|
|
209
|
+
* The inversion of the trap: the default is a trace that populates both bags,
|
|
210
|
+
* and every way of getting a weaker one — a `bags` opt-out on an event, a
|
|
211
|
+
* hand-normalized event with an empty record — has to be named in `allow`
|
|
212
|
+
* before this will hand it back.
|
|
213
|
+
*/
|
|
214
|
+
export declare function traceFixture(events: readonly TraceEvent[], options?: TraceFixtureOptions): TraceFixture;
|
|
215
|
+
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/dogwood/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAyBH,0CAA0C;AAC1C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC9B,QAAQ,CAAC,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,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;CACxC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,OAAO,GAAE,mBAAwB,GAChC,YAAY,CAcd"}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,10 +18,18 @@ export { CedarGenerator, loadActionConstants, sanitizeName, CEDAR_PACKAGE } from
|
|
|
18
18
|
export type { CedarGenerateOptions, CedarGenerateResult } from "./import/generator.js";
|
|
19
19
|
export { CedarTemplateParser, CedarTemplateGenerator } from "./import/adapter.js";
|
|
20
20
|
export { detectTemplate } from "./detect.js";
|
|
21
|
+
export { agentCoreStatement, agentCorePolicyDefinition, agentCorePolicyResource, agentCorePolicySet, agentCoreStagedPolicy, agentCorePolicyName, AGENTCORE_NAME_PATTERN, AGENTCORE_STATEMENT_MIN, AGENTCORE_STATEMENT_MAX, } from "./agentcore/embed.js";
|
|
22
|
+
export type { AgentCoreCedarDefinition, AgentCoreEmbedOptions, AgentCoreLanguageDefinition, AgentCorePolicyDefinition, AgentCorePolicyResource, AgentCorePolicySource, AgentCoreStagedPolicy, } from "./agentcore/embed.js";
|
|
23
|
+
export { AGENTCORE_ENFORCEMENT, describeStage, enforcementMode, enforcementStage, isEnforcing, } from "./agentcore/enforcement.js";
|
|
24
|
+
export type { AgentCoreEnforcementMode, AgentCoreStage } from "./agentcore/enforcement.js";
|
|
25
|
+
export { embeddedAgentCoreDefinitions, embeddedAgentCorePolicyStatements } from "./agentcore/scan.js";
|
|
26
|
+
export type { EmbeddedAgentCoreDefinition, EmbeddedAgentCoreStatement } from "./agentcore/scan.js";
|
|
21
27
|
export * as dogwood from "./dogwood/index.js";
|
|
22
28
|
export { DOGWOOD_EVENT_SCHEMA_FILENAME, DOGWOOD_EVENT_SCHEMA_TYPE, DOGWOOD_MACRO_FILENAME, DOGWOOD_MACRO_LIBRARY_TYPE, DOGWOOD_POLICY_FILENAME, DOGWOOD_POLICY_TYPE, TemporalEventSchema, TemporalMacroLibrary, TemporalPolicy, } from "./dogwood/policy.js";
|
|
23
29
|
export type { EventSchemaProps, MacroLibraryProps, TemporalPolicyProps } from "./dogwood/policy.js";
|
|
24
30
|
export { DOGWOOD_UPSTREAM } from "./dogwood/upstream.js";
|
|
31
|
+
export { DEFAULT_REPLAY_REPORT_PATH, PolicyReplayOp, dogwoodReplayReportStep, dogwoodReplayStep, } from "./dogwood/replay-op.js";
|
|
32
|
+
export type { DogwoodReplayReportStepOpts, DogwoodReplayStepOpts, PolicyReplayOpConfig, PolicyReplayOpResources, } from "./dogwood/replay-op.js";
|
|
25
33
|
export { rules as cedarLintRules } from "./lint/rules/index.js";
|
|
26
34
|
export { packageLexicon } from "./codegen/package.js";
|
|
27
35
|
export type { PackageOptions, PackageResult } from "./codegen/package.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAIjG,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,a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,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACzF,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAI5C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIpE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7F,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAIzE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACpF,YAAY,EACV,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG5E,cAAc,mBAAmB,CAAC"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "5627f37594343736b5fadb695bfa9a897382050d7ad80438a9bce9f5ac17e3e9",
|
|
5
5
|
"meta.json": "b218779260169a193882aeee76e5ac559588f1682657a001fb0982cffb5843fc",
|
|
6
6
|
"types/index.d.ts": "9e53a1cb3c9ee38f9de2f3c0db9cc28a0b67c3649be410c341e2451b9b0076cd",
|
|
7
7
|
"rules/policy-shape.ts": "1654730d188b7163dbad3051c75a562198a96eda6d36ce35701f2b729bf45194",
|
|
@@ -20,13 +20,15 @@
|
|
|
20
20
|
"rules/dwdc010.ts": "0c619de07981b4b11bfa425bf4032142af1f90f255d3058a71551956124123f2",
|
|
21
21
|
"rules/dwdc011.ts": "88919f0d7460993b58e1883d0bfd48f6a8c8f4bc2d22c71902f9b0ee7b9edd07",
|
|
22
22
|
"rules/dwdc012.ts": "15434083488c5e617835e0ac3027cf92657c734076463abd526332f460cc7e8d",
|
|
23
|
+
"rules/dwdc013.ts": "1921d352c3cc0caeebdc679d1a241adc779a8d2dd62e97a272005b28dd3f2d9d",
|
|
23
24
|
"rules/dwde010.ts": "b39ecb0427fc19d9548a26dcd2b9e99d4eab289f57196da24374743c85553fb1",
|
|
24
25
|
"rules/dwde011.ts": "5e7f7dbcd9c581bba614fd5c17dcf1282a0b59caef931997c954cea46522251c",
|
|
25
26
|
"rules/dwds010.ts": "4939f7eb012998d7e27238db777ed7fec2721c2e25df0daec457ff2c62bfa648",
|
|
26
27
|
"rules/wasm-helpers.ts": "c4c3def1669a1818d19ff1864e78bdcbf956da31ca1a6adde7751830765dad6a",
|
|
27
28
|
"skills/chant-cedar-authoring.md": "1b036a72ef13342d402d0de1a68bec0a6f32365ab8485b95f63a971277fd249f",
|
|
28
29
|
"skills/chant-cedar-avp-embedding.md": "1096cc318374dc0683fae289040b089ffc0c7fa029c6b07d4acc19ebcd118b54",
|
|
29
|
-
"skills/chant-cedar-meta-policy.md": "050b310a87196a48c827f1129698e4c6bbcd96dc963782e22bf1a640bbc20a1a"
|
|
30
|
+
"skills/chant-cedar-meta-policy.md": "050b310a87196a48c827f1129698e4c6bbcd96dc963782e22bf1a640bbc20a1a",
|
|
31
|
+
"skills/chant-cedar-dogwood.md": "fc8c9a2ea9cd7bf87037c156b0b419397d46fbf5cd201c09be721249ac91b8da"
|
|
30
32
|
},
|
|
31
|
-
"composite": "
|
|
33
|
+
"composite": "adff77c510732a1fdaea5bee081322121028216083d44b6ea5da1b91637c59f3"
|
|
32
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAoKtD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DWDC013: a temporal statement embedded in AgentCore needs its event schema
|
|
3
|
+
* registered
|
|
4
|
+
*
|
|
5
|
+
* `AWS::BedrockAgentCore::Policy` carries one string. When that string is `.dw`
|
|
6
|
+
* text — `Definition.Policy.Statement`, the language-agnostic arm — the policy
|
|
7
|
+
* engine at the other end has to know what an event *is* before any temporal
|
|
8
|
+
* predicate in it can match: which kinds exist, what fields they carry, and
|
|
9
|
+
* what is pinned to the deciding request. That is the `.dwschema` half of the
|
|
10
|
+
* schema, and the resource has no property to put it in.
|
|
11
|
+
*
|
|
12
|
+
* So a build that embeds temporal text and emits no event schema has shipped
|
|
13
|
+
* half a policy. Nothing fails: the statement deploys, the predicates match
|
|
14
|
+
* nothing, and a `formerly`-guarded permit stops granting — or a
|
|
15
|
+
* `formerly`-guarded forbid stops denying, which is the direction that
|
|
16
|
+
* matters. That is the silent trap this check exists for — the emitted schema
|
|
17
|
+
* is the artifact that makes the other half reviewable, whether it is
|
|
18
|
+
* registered with the engine out of band or shipped to a `dogwood validate`
|
|
19
|
+
* run.
|
|
20
|
+
*
|
|
21
|
+
* Warning rather than error, because "not emitted here" is not the same as
|
|
22
|
+
* "does not exist": a project may register the service schema through a
|
|
23
|
+
* separate pipeline, and failing that build would be chant asserting a fact it
|
|
24
|
+
* cannot check. Emitting one with `TemporalEventSchema` silences it and makes
|
|
25
|
+
* the assumption visible in the diff.
|
|
26
|
+
*
|
|
27
|
+
* The complement of DWDC010, which asks whether the kinds a `.dw` file names
|
|
28
|
+
* are declared. This one asks the prior question, and only of statements that
|
|
29
|
+
* left the `.dw` file behind.
|
|
30
|
+
*/
|
|
31
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
32
|
+
export declare const dwdc013: PostSynthCheck;
|
|
33
|
+
//# sourceMappingURL=dwdc013.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dwdc013.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/dwdc013.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAI9G,eAAO,MAAM,OAAO,EAAE,cA6BrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAmBvE,eAAO,MAAM,eAAe,EAAE,cAAc,EAkB3C,CAAC"}
|
package/dist/manifest.json
CHANGED
package/dist/okf/index.md
CHANGED
|
@@ -38,6 +38,7 @@ okf_version: '0.2'
|
|
|
38
38
|
* [DWDC010](/rules/DWDC010.md) - A dogwood temporal predicate names an event kind the emitted .dwschema declares
|
|
39
39
|
* [DWDC011](/rules/DWDC011.md) - A dogwood temporal window stays inside the event schema's max_window cap
|
|
40
40
|
* [DWDC012](/rules/DWDC012.md) - A dogwood formerly/previous/since operator carries its mandatory within window
|
|
41
|
+
* [DWDC013](/rules/DWDC013.md) - An embedded AgentCore temporal statement has its event schema emitted beside it
|
|
41
42
|
* [DWDE010](/rules/DWDE010.md) - Emitted dogwood policy sets validate clean under `dogwood validate`, when the binary is available
|
|
42
43
|
* [DWDE011](/rules/DWDE011.md) - The Cedar `dogwood lower` produces validates clean against the augmented schema (cedar-wasm validate)
|
|
43
44
|
* [DWDS010](/rules/DWDS010.md) - An emitted dogwood event schema pins its temporal predicates to a request-side value
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: DWDC013
|
|
4
|
+
description: An embedded AgentCore temporal statement has its event schema emitted beside it
|
|
5
|
+
id: DWDC013
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: cedar
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/cedar/rules/
|
|
10
|
+
---
|
|
11
|
+
An embedded AgentCore temporal statement has its event schema emitted beside it
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Policy](/types/Policy.md)
|
package/dist/okf/types/Policy.md
CHANGED
|
@@ -27,3 +27,4 @@ A Cedar policy — the unit this lexicon serializes to .cedar text and the JSON
|
|
|
27
27
|
- [CEDE011](/rules/CEDE011.md): Cedar validation warnings (impossible policies, shadowed conditions) on an emitted policy set
|
|
28
28
|
- [CEDS010](/rules/CEDS010.md): A bare permit(principal, action, resource) with no scope constraints and no conditions grants everything
|
|
29
29
|
- [CEDS012](/rules/CEDS012.md): A permit that leaves the action scope unconstrained grants every action, including future ones
|
|
30
|
+
- [DWDC013](/rules/DWDC013.md): An embedded AgentCore temporal statement has its event schema emitted beside it
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cedar Op activities — resolved by the core activity registry when a
|
|
3
|
+
* project's `chant.config.ts` lists the `cedar` lexicon.
|
|
4
|
+
*
|
|
5
|
+
* The registry keys every exported *function* in this module by its name
|
|
6
|
+
* (`loadActivities` → `collectActivities`), which is why only the activities
|
|
7
|
+
* themselves are exported here. `dogwoodReplay`'s helpers — the input
|
|
8
|
+
* resolver, the verdict comparison, the summary renderer — stay importable
|
|
9
|
+
* from `@intentius/chant-lexicon-cedar/dogwood/replay-activity` rather than
|
|
10
|
+
* being registered as activities nobody would ever name in a step.
|
|
11
|
+
*
|
|
12
|
+
* Contributed the `flyApply` way: a plain async function taking one args
|
|
13
|
+
* object, with no Temporal import anywhere beneath it, so the local executor
|
|
14
|
+
* runs it unchanged and a Temporal worker registers the same function.
|
|
15
|
+
*/
|
|
16
|
+
export { dogwoodReplay, dogwoodReplayReport } from "../../dogwood/replay-activity.js";
|
|
17
|
+
export type { DogwoodReplayArgs, DogwoodReplayReportArgs, ExpectedVerdict, PolicyReplayDispatch, PolicyReplayMode, PolicyReplayReport, ReplayDivergence, ReplayExpectation, } from "../../dogwood/replay-activity.js";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACnF,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,+BAA+B,CAAC"}
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAkD,MAAM,0BAA0B,CAAC;AAuB9G;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAkD,MAAM,0BAA0B,CAAC;AAuB9G;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,aAyTzB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DWDC013: a temporal statement embedded in AgentCore needs its event schema
|
|
3
|
+
* registered
|
|
4
|
+
*
|
|
5
|
+
* `AWS::BedrockAgentCore::Policy` carries one string. When that string is `.dw`
|
|
6
|
+
* text — `Definition.Policy.Statement`, the language-agnostic arm — the policy
|
|
7
|
+
* engine at the other end has to know what an event *is* before any temporal
|
|
8
|
+
* predicate in it can match: which kinds exist, what fields they carry, and
|
|
9
|
+
* what is pinned to the deciding request. That is the `.dwschema` half of the
|
|
10
|
+
* schema, and the resource has no property to put it in.
|
|
11
|
+
*
|
|
12
|
+
* So a build that embeds temporal text and emits no event schema has shipped
|
|
13
|
+
* half a policy. Nothing fails: the statement deploys, the predicates match
|
|
14
|
+
* nothing, and a `formerly`-guarded permit stops granting — or a
|
|
15
|
+
* `formerly`-guarded forbid stops denying, which is the direction that
|
|
16
|
+
* matters. That is the silent trap this check exists for — the emitted schema
|
|
17
|
+
* is the artifact that makes the other half reviewable, whether it is
|
|
18
|
+
* registered with the engine out of band or shipped to a `dogwood validate`
|
|
19
|
+
* run.
|
|
20
|
+
*
|
|
21
|
+
* Warning rather than error, because "not emitted here" is not the same as
|
|
22
|
+
* "does not exist": a project may register the service schema through a
|
|
23
|
+
* separate pipeline, and failing that build would be chant asserting a fact it
|
|
24
|
+
* cannot check. Emitting one with `TemporalEventSchema` silences it and makes
|
|
25
|
+
* the assumption visible in the diff.
|
|
26
|
+
*
|
|
27
|
+
* The complement of DWDC010, which asks whether the kinds a `.dw` file names
|
|
28
|
+
* are declared. This one asks the prior question, and only of statements that
|
|
29
|
+
* left the `.dw` file behind.
|
|
30
|
+
*/
|
|
31
|
+
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
32
|
+
import { embeddedAgentCorePolicyStatements } from "../../agentcore/scan";
|
|
33
|
+
import { dogwoodSchemaFiles, temporalRegions } from "../../dogwood/scan";
|
|
34
|
+
|
|
35
|
+
export const dwdc013: PostSynthCheck = {
|
|
36
|
+
id: "DWDC013",
|
|
37
|
+
description: "An embedded AgentCore temporal statement has its event schema emitted beside it",
|
|
38
|
+
|
|
39
|
+
check(ctx: PostSynthContext): PostSynthDiagnostic[] {
|
|
40
|
+
if (dogwoodSchemaFiles(ctx).length > 0) return [];
|
|
41
|
+
|
|
42
|
+
const diagnostics: PostSynthDiagnostic[] = [];
|
|
43
|
+
const seen = new Set<string>();
|
|
44
|
+
|
|
45
|
+
for (const embedded of embeddedAgentCorePolicyStatements(ctx)) {
|
|
46
|
+
if (temporalRegions(embedded.statement).length === 0) continue;
|
|
47
|
+
|
|
48
|
+
const named = embedded.logicalId ?? embedded.source;
|
|
49
|
+
const key = `${embedded.lexicon}:${embedded.source}:${named}`;
|
|
50
|
+
if (seen.has(key)) continue;
|
|
51
|
+
seen.add(key);
|
|
52
|
+
|
|
53
|
+
diagnostics.push({
|
|
54
|
+
checkId: "DWDC013",
|
|
55
|
+
severity: "warning",
|
|
56
|
+
message: `AgentCore policy "${named}" in "${embedded.source}" carries temporal text in Definition.Policy.Statement, but the build emitted no .dwschema event schema. The policy engine needs the event kinds and their pins registered before any temporal predicate can match; without them the clause never fires and the policy silently stops doing its job. Declare a TemporalEventSchema, or record where the service schema is registered.`,
|
|
57
|
+
entity: named,
|
|
58
|
+
lexicon: embedded.lexicon,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return diagnostics;
|
|
63
|
+
},
|
|
64
|
+
};
|