@directive-run/knowledge 1.21.0 → 1.22.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 +4 -4
- package/core/choosing-primitives.md +2 -1
- package/core/resolvers.md +26 -1
- package/package.json +3 -3
- package/sitemap.md +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @directive-run/knowledge
|
|
2
2
|
|
|
3
|
-
The **source of truth** for all Directive coding knowledge
|
|
3
|
+
The **source of truth** for all Directive coding knowledge – used by Claude Code skills, Cursor / Copilot / Windsurf / Cline / Codex rules files, the website's `/llms.txt` route, and the programmatic API for downstream tooling.
|
|
4
4
|
|
|
5
|
-
If you want your AI assistant to write idiomatic Directive code, you do not install this package directly
|
|
5
|
+
If you want your AI assistant to write idiomatic Directive code, you do not install this package directly – you install one of its consumers below.
|
|
6
6
|
|
|
7
7
|
## Using the knowledge
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ Two commands in a Claude Code session:
|
|
|
15
15
|
/plugin install directive@directive-plugins
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Ships 12 skills bundled from this package. Skills are model-invoked
|
|
18
|
+
Ships 12 skills bundled from this package. Skills are model-invoked – Claude reads each skill's description and auto-loads the relevant one when your task matches.
|
|
19
19
|
|
|
20
20
|
### Cursor, Copilot, Windsurf, Cline, OpenAI Codex
|
|
21
21
|
|
|
@@ -63,7 +63,7 @@ const examples = getAllExamples();
|
|
|
63
63
|
clearCache();
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
If you're just trying to write code with AI help, you don't need this
|
|
66
|
+
If you're just trying to write code with AI help, you don't need this – install the Claude plugin or run `directive ai-rules` above.
|
|
67
67
|
|
|
68
68
|
## What's in the package
|
|
69
69
|
|
|
@@ -156,7 +156,8 @@ seven pieces of work, zero `useEffect` hooks.
|
|
|
156
156
|
- [`sources.md`](./sources.md) — the source primitive's full lifecycle
|
|
157
157
|
and recipes.
|
|
158
158
|
- [`constraints.md`](./constraints.md) — `when` predicates, requirement
|
|
159
|
-
shapes, and the `
|
|
159
|
+
shapes, and the `abortOn` field-scoped CAS contract (v1; `bind:` is a
|
|
160
|
+
v2 reservation – see RFC 0003 Future Work).
|
|
160
161
|
- [`resolvers.md`](./resolvers.md) — retry config, batch semantics, and
|
|
161
162
|
the `ctx.set` write contract.
|
|
162
163
|
- [`anti-patterns.md`](./anti-patterns.md) — the things to avoid that
|
package/core/resolvers.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Resolvers
|
|
2
2
|
|
|
3
|
-
> Covers `@directive-run/core` — resolver definition: retry policies, batching, cancellation, custom dedup keys, `
|
|
3
|
+
> Covers `@directive-run/core` — resolver definition: retry policies, batching, cancellation, custom dedup keys, `abortOn` binding.
|
|
4
4
|
|
|
5
5
|
Resolvers fulfill requirements emitted by constraints. They are the supply side of the constraint-resolver pattern. Resolvers handle async work and mutate state through `context.facts`.
|
|
6
6
|
|
|
@@ -205,6 +205,31 @@ resolvers: {
|
|
|
205
205
|
|
|
206
206
|
Failed items from `resolveBatchWithResults` can be individually retried if a retry policy is configured.
|
|
207
207
|
|
|
208
|
+
## `abortOn` binding (constraint-side)
|
|
209
|
+
|
|
210
|
+
Declared on the *constraint*, not the resolver. Lists facts whose values
|
|
211
|
+
must remain unchanged between dispatch and the resolver's writes; if any
|
|
212
|
+
of them changes mid-flight, the resolver's writes are dropped and its
|
|
213
|
+
signal is aborted.
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
constraints: {
|
|
217
|
+
finalizeKyc: {
|
|
218
|
+
when: (f) => f.kyc.status === "pending",
|
|
219
|
+
require: { type: "FINALIZE_KYC" },
|
|
220
|
+
abortOn: ["kyc.status"], // abort if `kyc.status` changes mid-flight
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
`abortOn:` does **not** lock or gate other writers. It only protects this
|
|
226
|
+
resolver from clobbering with stale data when its tail write attempts a
|
|
227
|
+
value the world has since moved past. See
|
|
228
|
+
[`/docs/resolver-binding`](https://directive.run/docs/resolver-binding)
|
|
229
|
+
for the full lifecycle, ABA caveats, and the audit event
|
|
230
|
+
(`resolver.write.rejected { reason: "clobbered" }`) that fires on a
|
|
231
|
+
dropped write.
|
|
232
|
+
|
|
208
233
|
## Timeout
|
|
209
234
|
|
|
210
235
|
```typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@directive-run/knowledge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "Knowledge files, examples, and validation for Directive — the constraint-driven TypeScript runtime.",
|
|
5
5
|
"license": "(MIT OR Apache-2.0)",
|
|
6
6
|
"author": "Jason Comes",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"tsx": "^4.19.2",
|
|
54
54
|
"typescript": "^5.7.2",
|
|
55
55
|
"vitest": "^3.0.0",
|
|
56
|
-
"@directive-run/core": "1.
|
|
57
|
-
"@directive-run/ai": "1.
|
|
56
|
+
"@directive-run/core": "1.22.0",
|
|
57
|
+
"@directive-run/ai": "1.22.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "tsx scripts/generate-api-skeleton.ts && tsx scripts/generate-sitemap.ts && tsx scripts/extract-examples.ts && tsup",
|
package/sitemap.md
CHANGED
|
@@ -63,7 +63,7 @@ Website: https://directive.run
|
|
|
63
63
|
### Advanced Patterns
|
|
64
64
|
- [Overview](https://directive.run/docs/advanced/overview)
|
|
65
65
|
- [Data-form Definitions](https://directive.run/docs/data-triggers)
|
|
66
|
-
- [Resolver Binding
|
|
66
|
+
- [Resolver Binding](https://directive.run/docs/resolver-binding)
|
|
67
67
|
- [Multi-Module](https://directive.run/docs/advanced/multi-module)
|
|
68
68
|
- [Runtime Dynamics](https://directive.run/docs/advanced/runtime)
|
|
69
69
|
- [History & Snapshots](https://directive.run/docs/advanced/history)
|