foottrace 1.1.0 → 1.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.
Files changed (88) hide show
  1. package/README.md +96 -2
  2. package/dist/cause.js +14 -0
  3. package/dist/esm/cause.d.ts +8 -0
  4. package/dist/esm/cause.js +5 -0
  5. package/dist/esm/index.d.ts +2 -0
  6. package/dist/esm/lib/cause/admission.d.ts +27 -0
  7. package/dist/esm/lib/cause/admission.js +59 -0
  8. package/dist/esm/lib/cause/explain.d.ts +5 -0
  9. package/dist/esm/lib/cause/explain.js +114 -0
  10. package/dist/esm/lib/cause/ranking.d.ts +6 -0
  11. package/dist/esm/lib/cause/ranking.js +10 -0
  12. package/dist/esm/lib/cause/recordAdapter.d.ts +9 -0
  13. package/dist/esm/lib/cause/recordAdapter.js +49 -0
  14. package/dist/esm/lib/cause/recordChildren.d.ts +4 -0
  15. package/dist/esm/lib/cause/recordChildren.js +79 -0
  16. package/dist/esm/lib/cause/recordControl.d.ts +13 -0
  17. package/dist/esm/lib/cause/recordControl.js +66 -0
  18. package/dist/esm/lib/cause/recordCoverage.d.ts +24 -0
  19. package/dist/esm/lib/cause/recordCoverage.js +87 -0
  20. package/dist/esm/lib/cause/recordIdentity.d.ts +9 -0
  21. package/dist/esm/lib/cause/recordIdentity.js +67 -0
  22. package/dist/esm/lib/cause/recordLoading.d.ts +7 -0
  23. package/dist/esm/lib/cause/recordLoading.js +116 -0
  24. package/dist/esm/lib/cause/recordParents.d.ts +4 -0
  25. package/dist/esm/lib/cause/recordParents.js +86 -0
  26. package/dist/esm/lib/cause/recordScope.d.ts +8 -0
  27. package/dist/esm/lib/cause/recordScope.js +60 -0
  28. package/dist/esm/lib/cause/recordTypes.d.ts +67 -0
  29. package/dist/esm/lib/cause/recordTypes.js +1 -0
  30. package/dist/esm/lib/cause/recordValidation.d.ts +33 -0
  31. package/dist/esm/lib/cause/recordValidation.js +198 -0
  32. package/dist/esm/lib/cause/session.d.ts +30 -0
  33. package/dist/esm/lib/cause/session.js +161 -0
  34. package/dist/esm/lib/cause/storedRecordAdapter.d.ts +11 -0
  35. package/dist/esm/lib/cause/storedRecordAdapter.js +57 -0
  36. package/dist/esm/lib/cause/strategies.d.ts +3 -0
  37. package/dist/esm/lib/cause/strategies.js +21 -0
  38. package/dist/esm/lib/cause/types.d.ts +90 -0
  39. package/dist/esm/lib/cause/types.js +1 -0
  40. package/dist/esm/lib/cause/validation.d.ts +24 -0
  41. package/dist/esm/lib/cause/validation.js +134 -0
  42. package/dist/esm/lib/cause/walk.d.ts +12 -0
  43. package/dist/esm/lib/cause/walk.js +174 -0
  44. package/dist/esm/lib/memory/types.d.ts +4 -1
  45. package/dist/esm/lib/memory/types.js +1 -1
  46. package/dist/lib/cause/admission.js +67 -0
  47. package/dist/lib/cause/explain.js +119 -0
  48. package/dist/lib/cause/ranking.js +14 -0
  49. package/dist/lib/cause/recordAdapter.js +55 -0
  50. package/dist/lib/cause/recordChildren.js +83 -0
  51. package/dist/lib/cause/recordControl.js +74 -0
  52. package/dist/lib/cause/recordCoverage.js +99 -0
  53. package/dist/lib/cause/recordIdentity.js +73 -0
  54. package/dist/lib/cause/recordLoading.js +121 -0
  55. package/dist/lib/cause/recordParents.js +90 -0
  56. package/dist/lib/cause/recordScope.js +66 -0
  57. package/dist/lib/cause/recordTypes.js +2 -0
  58. package/dist/lib/cause/recordValidation.js +213 -0
  59. package/dist/lib/cause/session.js +165 -0
  60. package/dist/lib/cause/storedRecordAdapter.js +61 -0
  61. package/dist/lib/cause/strategies.js +26 -0
  62. package/dist/lib/cause/types.js +2 -0
  63. package/dist/lib/cause/validation.js +150 -0
  64. package/dist/lib/cause/walk.js +180 -0
  65. package/dist/lib/memory/types.js +1 -1
  66. package/dist/types/cause.d.ts +8 -0
  67. package/dist/types/index.d.ts +2 -0
  68. package/dist/types/lib/cause/admission.d.ts +27 -0
  69. package/dist/types/lib/cause/explain.d.ts +5 -0
  70. package/dist/types/lib/cause/ranking.d.ts +6 -0
  71. package/dist/types/lib/cause/recordAdapter.d.ts +9 -0
  72. package/dist/types/lib/cause/recordChildren.d.ts +4 -0
  73. package/dist/types/lib/cause/recordControl.d.ts +13 -0
  74. package/dist/types/lib/cause/recordCoverage.d.ts +24 -0
  75. package/dist/types/lib/cause/recordIdentity.d.ts +9 -0
  76. package/dist/types/lib/cause/recordLoading.d.ts +7 -0
  77. package/dist/types/lib/cause/recordParents.d.ts +4 -0
  78. package/dist/types/lib/cause/recordScope.d.ts +8 -0
  79. package/dist/types/lib/cause/recordTypes.d.ts +67 -0
  80. package/dist/types/lib/cause/recordValidation.d.ts +33 -0
  81. package/dist/types/lib/cause/session.d.ts +30 -0
  82. package/dist/types/lib/cause/storedRecordAdapter.d.ts +11 -0
  83. package/dist/types/lib/cause/strategies.d.ts +3 -0
  84. package/dist/types/lib/cause/types.d.ts +90 -0
  85. package/dist/types/lib/cause/validation.d.ts +24 -0
  86. package/dist/types/lib/cause/walk.d.ts +12 -0
  87. package/dist/types/lib/memory/types.d.ts +4 -1
  88. package/package.json +67 -13
@@ -2,10 +2,11 @@
2
2
  * types.ts — the record's types: a bundle, its rows, its patches, its encoding, and the
3
3
  * execution tree as the record's readers read it.
4
4
  *
5
- * Imports nothing. The standalone record names nothing outside itself: the engine's frame
5
+ * Imports only the record's leaf attention type. The record names nothing outside itself: the engine's frame
6
6
  * types — the stage snapshot, flow messages and retention dials — remain in FootPrint's
7
7
  * `frameTypes.ts`. The closed record graph is enforced by scripts/check-layering.mjs.
8
8
  */
9
+ import type { Attention } from '../cause/types.js';
9
10
  /** A flat key-value bag representing a state patch (overwrite or merge). */
10
11
  export interface MemoryPatch {
11
12
  [key: string]: any;
@@ -194,6 +195,8 @@ export type CommitValuesMode = 'full' | 'delta';
194
195
  * ```
195
196
  */
196
197
  export interface ExecutionTree {
198
+ /** Optional recorded business attention; absence does not assert health. */
199
+ readonly attention?: readonly Attention[];
197
200
  /** The stage's id (prefixed inside a subflow). `commitStops` reads the root's to place a subflow's seed. */
198
201
  readonly id?: string;
199
202
  /** `[subflowPath/]stageId#executionIndex` — what a reader keys on. A node without one is not a stage. */
package/package.json CHANGED
@@ -1,45 +1,99 @@
1
1
  {
2
2
  "name": "foottrace",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "commonjs",
5
- "description": "Execution records, replay, time travel and honest attribution — independent of the engine that produced them",
5
+ "description": "Execution records, replay, time travel and honest attribution \u2014 independent of the engine that produced them",
6
6
  "license": "MIT",
7
7
  "author": "Sanjay Krishna Anbalagan <sanjay@footprintjs.dev>",
8
- "repository": { "type": "git", "url": "git+https://github.com/footprintjs/foottrace.git" },
9
- "bugs": { "url": "https://github.com/footprintjs/foottrace/issues" },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/footprintjs/foottrace.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/footprintjs/foottrace/issues"
14
+ },
10
15
  "homepage": "https://github.com/footprintjs/foottrace#readme",
11
- "engines": { "node": ">=22" },
16
+ "engines": {
17
+ "node": ">=22"
18
+ },
12
19
  "sideEffects": false,
13
20
  "main": "./dist/index.js",
14
21
  "module": "./dist/esm/index.js",
15
22
  "types": "./dist/types/index.d.ts",
16
- "files": ["dist/"],
23
+ "files": [
24
+ "dist/"
25
+ ],
17
26
  "exports": {
18
- ".": { "import": { "types": "./dist/esm/index.d.ts", "default": "./dist/esm/index.js" }, "require": { "types": "./dist/types/index.d.ts", "default": "./dist/index.js" } },
19
- "./write": { "import": { "types": "./dist/esm/write.d.ts", "default": "./dist/esm/write.js" }, "require": { "types": "./dist/types/write.d.ts", "default": "./dist/write.js" } },
20
- "./paths": { "import": { "types": "./dist/esm/paths.d.ts", "default": "./dist/esm/paths.js" }, "require": { "types": "./dist/types/paths.d.ts", "default": "./dist/paths.js" } },
21
- "./package.json": "./package.json"
27
+ ".": {
28
+ "import": {
29
+ "types": "./dist/esm/index.d.ts",
30
+ "default": "./dist/esm/index.js"
31
+ },
32
+ "require": {
33
+ "types": "./dist/types/index.d.ts",
34
+ "default": "./dist/index.js"
35
+ }
36
+ },
37
+ "./write": {
38
+ "import": {
39
+ "types": "./dist/esm/write.d.ts",
40
+ "default": "./dist/esm/write.js"
41
+ },
42
+ "require": {
43
+ "types": "./dist/types/write.d.ts",
44
+ "default": "./dist/write.js"
45
+ }
46
+ },
47
+ "./paths": {
48
+ "import": {
49
+ "types": "./dist/esm/paths.d.ts",
50
+ "default": "./dist/esm/paths.js"
51
+ },
52
+ "require": {
53
+ "types": "./dist/types/paths.d.ts",
54
+ "default": "./dist/paths.js"
55
+ }
56
+ },
57
+ "./package.json": "./package.json",
58
+ "./cause": {
59
+ "import": {
60
+ "types": "./dist/esm/cause.d.ts",
61
+ "default": "./dist/esm/cause.js"
62
+ }
63
+ }
64
+ },
65
+ "typesVersions": {
66
+ "*": {
67
+ "write": [
68
+ "dist/types/write.d.ts"
69
+ ],
70
+ "paths": [
71
+ "dist/types/paths.d.ts"
72
+ ],
73
+ "cause": [
74
+ "dist/esm/cause.d.ts"
75
+ ]
76
+ }
22
77
  },
23
- "typesVersions": { "*": { "write": ["dist/types/write.d.ts"], "paths": ["dist/types/paths.d.ts"] } },
24
78
  "scripts": {
25
79
  "build": "tsc -p tsconfig.json && tsc -p tsconfig.esm.json && node scripts/postbuild-esm.mjs",
26
80
  "test": "vitest run",
27
81
  "test:coverage": "vitest run --coverage",
28
82
  "typecheck": "tsc -p tsconfig.test.json",
29
83
  "check:layering": "node scripts/check-layering.mjs",
30
- "check:package": "publint && attw --pack",
84
+ "check:package": "publint && attw --pack --exclude-entrypoints cause --profile strict && attw --pack --entrypoints cause --profile esm-only",
31
85
  "lint": "eslint 'src/**/*.ts'",
32
86
  "format": "prettier --check 'src/**/*.ts' 'test/**/*.ts'",
33
87
  "test:examples": "tsc -p examples/tsconfig.json",
34
88
  "check": "npm run build && npm run typecheck && npm test && npm run check:layering && npm run lint && npm run format && npm run check:package && npm run test:examples"
35
89
  },
36
- "dependencies": {},
37
90
  "devDependencies": {
38
91
  "@arethetypeswrong/cli": "^0.18.1",
39
92
  "@types/node": "^22.0.0",
40
93
  "@typescript-eslint/eslint-plugin": "^8.71.1",
41
94
  "@typescript-eslint/parser": "^8.71.1",
42
95
  "@vitest/coverage-v8": "4.1.11",
96
+ "esbuild": "0.28.2",
43
97
  "eslint": "^8.57.1",
44
98
  "fast-check": "^4.4.0",
45
99
  "prettier": "^2.8.1",