@fulmenhq/tsfulmen 0.3.3 → 0.4.1

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 (123) hide show
  1. package/CHANGELOG.md +76 -1
  2. package/README.md +30 -1
  3. package/config/crucible-ts/taxonomy/metrics.yaml +1 -1
  4. package/dist/appidentity/index.js +9 -2209
  5. package/dist/appidentity/index.js.map +1 -1
  6. package/dist/assets/index.d.ts +184 -0
  7. package/dist/assets/index.js +4 -0
  8. package/dist/assets/index.js.map +1 -0
  9. package/dist/bin/prometheus-cli.js +15 -9139
  10. package/dist/bin/prometheus-cli.js.map +1 -1
  11. package/dist/bin/schema-cli.js +4 -6098
  12. package/dist/bin/schema-cli.js.map +1 -1
  13. package/dist/bin/signals-cli.js +15 -1910
  14. package/dist/bin/signals-cli.js.map +1 -1
  15. package/dist/chunk-24BAF63H.js +194 -0
  16. package/dist/chunk-24BAF63H.js.map +1 -0
  17. package/dist/chunk-3HISR2XI.js +36 -0
  18. package/dist/chunk-3HISR2XI.js.map +1 -0
  19. package/dist/chunk-56F2EEAG.js +328 -0
  20. package/dist/chunk-56F2EEAG.js.map +1 -0
  21. package/dist/chunk-5HZEJGZ5.js +725 -0
  22. package/dist/chunk-5HZEJGZ5.js.map +1 -0
  23. package/dist/chunk-7YWACZEJ.js +837 -0
  24. package/dist/chunk-7YWACZEJ.js.map +1 -0
  25. package/dist/chunk-BCO3FUUO.js +682 -0
  26. package/dist/chunk-BCO3FUUO.js.map +1 -0
  27. package/dist/chunk-GOTEQYAD.js +410 -0
  28. package/dist/chunk-GOTEQYAD.js.map +1 -0
  29. package/dist/chunk-HY6JQOFN.js +32 -0
  30. package/dist/chunk-HY6JQOFN.js.map +1 -0
  31. package/dist/chunk-LMNAUTW7.js +43 -0
  32. package/dist/chunk-LMNAUTW7.js.map +1 -0
  33. package/dist/chunk-LWAH2UG7.js +103 -0
  34. package/dist/chunk-LWAH2UG7.js.map +1 -0
  35. package/dist/chunk-OHE2AOH4.js +273 -0
  36. package/dist/chunk-OHE2AOH4.js.map +1 -0
  37. package/dist/chunk-P3DNOZOG.js +1488 -0
  38. package/dist/chunk-P3DNOZOG.js.map +1 -0
  39. package/dist/chunk-PQ6TKPUN.js +27 -0
  40. package/dist/chunk-PQ6TKPUN.js.map +1 -0
  41. package/dist/chunk-QCCN6POA.js +211 -0
  42. package/dist/chunk-QCCN6POA.js.map +1 -0
  43. package/dist/chunk-QGTNV4U2.js +985 -0
  44. package/dist/chunk-QGTNV4U2.js.map +1 -0
  45. package/dist/chunk-RSLFR4TO.js +631 -0
  46. package/dist/chunk-RSLFR4TO.js.map +1 -0
  47. package/dist/chunk-SNV5WG5V.js +9412 -0
  48. package/dist/chunk-SNV5WG5V.js.map +1 -0
  49. package/dist/chunk-UP2VWCW5.js +33 -0
  50. package/dist/chunk-UP2VWCW5.js.map +1 -0
  51. package/dist/chunk-VJIGX7MH.js +208 -0
  52. package/dist/chunk-VJIGX7MH.js.map +1 -0
  53. package/dist/chunk-WCCMRVZF.js +130 -0
  54. package/dist/chunk-WCCMRVZF.js.map +1 -0
  55. package/dist/chunk-WSMVLWLB.js +269 -0
  56. package/dist/chunk-WSMVLWLB.js.map +1 -0
  57. package/dist/config/index.js +6 -1220
  58. package/dist/config/index.js.map +1 -1
  59. package/dist/crucible/fulpack/index.js +2 -25
  60. package/dist/crucible/fulpack/index.js.map +1 -1
  61. package/dist/crucible/index.js +13 -1129
  62. package/dist/crucible/index.js.map +1 -1
  63. package/dist/docscribe/index.js +2 -680
  64. package/dist/docscribe/index.js.map +1 -1
  65. package/dist/errors/index.js +5 -1831
  66. package/dist/errors/index.js.map +1 -1
  67. package/dist/errors-D7KXV3QW.js +4 -0
  68. package/dist/errors-D7KXV3QW.js.map +1 -0
  69. package/dist/errors-R7ZODJXS.js +8 -0
  70. package/dist/errors-R7ZODJXS.js.map +1 -0
  71. package/dist/export-EA3RNQNS.js +6 -0
  72. package/dist/export-EA3RNQNS.js.map +1 -0
  73. package/dist/foundry/index.js +340 -3949
  74. package/dist/foundry/index.js.map +1 -1
  75. package/dist/foundry/similarity/index.js +3 -134
  76. package/dist/foundry/similarity/index.js.map +1 -1
  77. package/dist/fulencode/index.js +3 -319
  78. package/dist/fulencode/index.js.map +1 -1
  79. package/dist/fulhash/index.js +3 -611
  80. package/dist/fulhash/index.js.map +1 -1
  81. package/dist/fulpack/index.js +3 -1515
  82. package/dist/fulpack/index.js.map +1 -1
  83. package/dist/hash-YOJYVOWH.js +4 -0
  84. package/dist/hash-YOJYVOWH.js.map +1 -0
  85. package/dist/index.d.ts +1 -1
  86. package/dist/index.js +14 -4395
  87. package/dist/index.js.map +1 -1
  88. package/dist/loader-VP2ZIC4O.js +9 -0
  89. package/dist/loader-VP2ZIC4O.js.map +1 -0
  90. package/dist/logging/index.js +2 -723
  91. package/dist/logging/index.js.map +1 -1
  92. package/dist/pathfinder/index.js +18 -2341
  93. package/dist/pathfinder/index.js.map +1 -1
  94. package/dist/prom-client-PNEBGD3G.js +4801 -0
  95. package/dist/prom-client-PNEBGD3G.js.map +1 -0
  96. package/dist/reports/license-inventory.csv +1 -1
  97. package/dist/schema/index.d.ts +19 -6
  98. package/dist/schema/index.js +4 -6148
  99. package/dist/schema/index.js.map +1 -1
  100. package/dist/signals/index.js +8 -2767
  101. package/dist/signals/index.js.map +1 -1
  102. package/dist/similarity/index.js +3 -134
  103. package/dist/similarity/index.js.map +1 -1
  104. package/dist/telemetry/http/index.js +9 -930
  105. package/dist/telemetry/http/index.js.map +1 -1
  106. package/dist/telemetry/index.js +4 -1561
  107. package/dist/telemetry/index.js.map +1 -1
  108. package/dist/telemetry/prometheus/index.js +7 -8422
  109. package/dist/telemetry/prometheus/index.js.map +1 -1
  110. package/dist/validator-I3ASDVDB.js +6 -0
  111. package/dist/validator-I3ASDVDB.js.map +1 -0
  112. package/package.json +5 -1
  113. package/schemas/crucible-ts/library/module-manifest/v1.0.0/module-manifest.schema.json +1 -1
  114. package/schemas/crucible-ts/observability/logging/v1.0.0/definitions.schema.json +1 -1
  115. package/schemas/crucible-ts/observability/logging/v1.0.0/log-event.schema.json +13 -13
  116. package/schemas/crucible-ts/observability/logging/v1.0.0/logger-config.schema.json +2 -2
  117. package/schemas/crucible-ts/observability/logging/v1.0.0/logging-policy.schema.json +1 -1
  118. package/schemas/crucible-ts/observability/logging/v1.0.0/middleware-config.schema.json +2 -2
  119. package/schemas/crucible-ts/observability/logging/v1.0.0/severity-filter.schema.json +3 -3
  120. package/schemas/crucible-ts/upstream/3leaps/crucible/PROVENANCE.md +3 -3
  121. package/schemas/crucible-ts/upstream/3leaps/crucible/docs/catalog/classifiers/README.md +1 -1
  122. package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/classifiers-framework.md +1 -1
  123. package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/data-sensitivity-classification.md +1 -1
package/CHANGELOG.md CHANGED
@@ -14,6 +14,81 @@ _No unreleased changes._
14
14
 
15
15
  ---
16
16
 
17
+ ## [0.4.1] - 2026-06-26
18
+
19
+ > **Patch — asset-resolver security hardening + CI tooling.** Hardens the public
20
+ > `./assets` surface (secrev follow-ups) and fixes the goneat format gate so Markdown
21
+ > drift is actually caught. No API removals; behavior change is limited to rejecting
22
+ > inputs that were never valid assets. Engine floor unchanged (`>=22.12.0`).
23
+
24
+ ### Security
25
+
26
+ - **`AssetResolver` namespace tightened to the shipped subtree** — logical paths/patterns
27
+ must resolve under `<namespace>/crucible-ts/` (the only subtree the package ships), not
28
+ just a `schemas`/`config`/`docs` top segment. Consumer `baseDir` overrides
29
+ (`enforceNamespace: false`) are unaffected.
30
+ - **`FsAssetResolver` rejects symlink escapes** — `read`/`has` now resolve symlinks
31
+ (`realpath`) and verify the target stays within `baseDir`, so a symlink in the asset
32
+ tree cannot read outside the asset root.
33
+
34
+ ### Changed
35
+
36
+ - **CI/tooling:** `.goneat/assess.yaml` gained a `format:` block so the format gate
37
+ (pre-commit/pre-push hooks + `goneat assess`) actually scopes Markdown/JSON/YAML;
38
+ `.goneatignore` expanded to exclude the Crucible-synced SSOT trees, generated modules,
39
+ and fixtures; and `make fmt` no longer silently no-ops (the `$GONEAT` subshell bug).
40
+ This closes the gap that let Markdown formatting drift slip past the gates in v0.4.0.
41
+
42
+ ## [0.4.0] - 2026-06-24
43
+
44
+ > **Minor — compile-safe SSOT asset embedding.** Makes every bundled SSOT asset
45
+ > (schemas, JSON-Schema metaschemas, foundry catalogs, telemetry taxonomy) resolve
46
+ > without the filesystem, so tsfulmen works fully inside a `bun build --compile`
47
+ > single-file binary — including standalone `serve`, schema discovery, and config
48
+ > validation. No public API removals; the new surface is additive. Engine floor
49
+ > unchanged (`>=22.12.0`). Full details in `docs/releases/v0.4.0.md`.
50
+
51
+ ### Added
52
+
53
+ - **`@fulmenhq/tsfulmen/assets` — `AssetResolver` layer.** Central resolution for
54
+ bundled SSOT assets with two backends: `FsAssetResolver` (on-disk) and
55
+ `EmbeddedAssetResolver` (build-embedded generated modules). `resolveAssets()` /
56
+ `getAssetResolver()` select via `TSFULMEN_ASSET_MODE` (`auto` | `fs` | `embedded`;
57
+ default `auto` — filesystem when present, embedded otherwise). Logical paths are
58
+ package-root-relative and validated against path traversal.
59
+ - **Embedded SSOT asset modules** (`src/assets/generated/`, checked in): per-domain
60
+ manifests (metaschema, schemas, foundry catalogs, taxonomy) so loads resolve with
61
+ no filesystem read in a compiled binary. Regenerated via `make embed-assets`;
62
+ drift-guarded by `make verify-embedded-assets` (in `check-all`).
63
+ - **Compile-safety guards** (CI-enforced): `verify-embedded-compile` (in-binary
64
+ read/enumerate **and** standalone `serve` from a temp cwd) and
65
+ `verify-dist-asset-partition` (public entries stay lean; corpus in exactly one
66
+ shared chunk; per-domain presence + size report).
67
+
68
+ ### Changed
69
+
70
+ - **All SSOT asset loads now route through the `AssetResolver`** — schema registry
71
+ discovery, validator metaschemas/vocabulary/`compileSchemaById`/cross-tree `$ref`
72
+ resolution, foundry catalogs + signals catalog, and telemetry taxonomy — replacing
73
+ `import.meta.url`/`__dirname`-relative `readFile`. `SchemaMetadata.path` is now a
74
+ logical (resolver-relative) path. Fixes latent cwd/layout fragility in addition to
75
+ enabling compile-safety.
76
+ - **Build emits shared chunks** (`tsup splitting: true`): the embedded corpus is
77
+ deduped into one shared chunk rather than duplicated per entry, and public entry
78
+ files stay lean. The full `dist/` tree drops to ~3.7 MB vs ~24 MB (~1.1 MB of that
79
+ is JS across all entries plus one shared corpus chunk; the rest is type declarations
80
+ and source maps). Published `dist/` now includes `chunk-*.js` (packed automatically
81
+ via `files: ["dist"]`).
82
+ - **Synced Crucible SSOT `v0.4.14 → v0.4.15`** — fixes cross-schema `$ref`/`$id`
83
+ vs. file-layout inconsistencies (observability/logging `$id` version-as-directory;
84
+ module-manifest relative-ref correction) surfaced by the resolver repoint.
85
+
86
+ ### Fixed
87
+
88
+ - **Standalone `serve`, schema discovery, and config validation work in
89
+ `bun build --compile` single-file binaries** — the foundry signals catalog and the
90
+ rest of the SSOT assets are no longer read from an absent on-disk tree.
91
+
17
92
  ## [0.3.3] - 2026-06-17
18
93
 
19
94
  > **Patch — compile-safety ergonomics.** Two purely-additive API options that let `bun --compile` single-file binary consumers register a build-embedded identity and load embedded config without per-consumer workarounds — ahead of the larger v0.4.0 SSOT-asset-embedding work. No breaking changes; the existing exported `LoadConfigOptions` shape is unchanged; engine floor unchanged (`>=22.12.0`). Full details in `docs/releases/v0.3.3.md`.
@@ -43,7 +118,7 @@ _No unreleased changes._
43
118
 
44
119
  ### Fixed
45
120
 
46
- - **CLI shadowing under `bun build --compile`** (#15) — the schema/signals/prometheus CLIs self-executed on import via the non-compile-safe guard `import.meta.url === \`file://${process.argv[1]}\``; under `--compile` it fired for non-entry modules, so a compiled consumer importing `@fulmenhq/tsfulmen/schema` ran `tsfulmen-schema` instead of its own program. The library modules no longer parse argv on import; executables moved to dedicated bin entries out of the importable graph.
121
+ - **CLI shadowing under `bun build --compile`** (#15) — the schema/signals/prometheus CLIs self-executed on import via a non-compile-safe main-module guard comparing `import.meta.url` to `process.argv[1]`; under `--compile` it fired for non-entry modules, so a compiled consumer importing `@fulmenhq/tsfulmen/schema` ran `tsfulmen-schema` instead of its own program. The library modules no longer parse argv on import; executables moved to dedicated bin entries out of the importable graph.
47
122
  - **Compiled-binary WASM `ENOENT` crash** (#14) — bump `@3leaps/string-metrics-wasm` 0.3.8 → 0.3.10, fixing the eager top-level WASM load that `--compile` rewrites but does not embed. Consumers no longer need an `overrides` entry.
48
123
 
49
124
  ### Added
package/README.md CHANGED
@@ -5,10 +5,11 @@
5
5
  Every team writes their own HTTP status helpers, exit code enums, and country code lookups. tsfulmen provides production-grade TypeScript implementations derived from a single source of truth—so your TypeScript/Node.js services use the same codes as your Go, Rust, and Python services.
6
6
 
7
7
  - **Zero runtime network calls**: All catalogs embedded at build time
8
+ - **Compile-safe**: Schemas, foundry catalogs, and standalone metrics `serve` resolve with no filesystem, so the full SDK runs inside a `bun build --compile` single-file binary
8
9
  - **Cross-language parity**: Same exit codes, signals, and schemas as gofulmen, rsfulmen, pyfulmen
9
10
  - **Type-safe**: Full TypeScript types with strict mode throughout
10
11
 
11
- **Lifecycle Phase**: `beta` | **Version**: 0.3.0 | **Test Coverage**: 71%
12
+ **Lifecycle Phase**: `beta` | **Version**: 0.4.0 | **Test Coverage**: 71%
12
13
 
13
14
  **Install**: `bun add @fulmenhq/tsfulmen` (or `npm install @fulmenhq/tsfulmen`)
14
15
 
@@ -38,6 +39,7 @@ Every team writes their own HTTP status helpers, exit code enums, and country co
38
39
  - ✅ **DocScribe** - Document processing with frontmatter parsing (50+ tests)
39
40
  - ✅ **Config Path API** - XDG-compliant configuration directory resolution (26 tests)
40
41
  - ✅ **Schema Validation** - JSON Schema 2020-12 validation with AJV and CLI (115 tests)
42
+ - ✅ **Compile-Safe Assets** - SSOT schemas, foundry catalogs, and telemetry taxonomy resolve with no filesystem (`AssetResolver` + `TSFULMEN_ASSET_MODE`), so schema validation and standalone `serve` run inside a `bun --compile` single-file binary
41
43
  - ✅ **Foundry Module** - Pattern catalogs, HTTP statuses, MIME detection, similarity (278 tests)
42
44
  - ✅ **Exit Codes** - Standardized process exit codes with simplified modes and platform detection (34 tests)
43
45
  - ✅ **Signal Handling** - Cross-platform signal handling with graceful shutdown and Windows fallback (180 tests)
@@ -196,6 +198,33 @@ process.chdir(repoRoot);
196
198
 
197
199
  See `docs/guides/crucible-assets.md` for deeper guidance.
198
200
 
201
+ ### Compile-Safe Assets & Single-File Binaries (v0.4.0)
202
+
203
+ tsfulmen resolves its bundled SSOT assets — JSON Schemas, metaschemas, foundry catalogs, and the telemetry taxonomy — through a single `AssetResolver` with filesystem and build-embedded backends. This makes the full SDK (schema validation, foundry catalogs, and standalone metrics `serve`) work inside a `bun build --compile` single-file binary, where no asset tree exists on disk.
204
+
205
+ ```typescript
206
+ import { getAssetResolver } from "@fulmenhq/tsfulmen/assets";
207
+
208
+ const resolver = getAssetResolver(); // auto: filesystem when present, embedded otherwise
209
+ const signals = await resolver.read(
210
+ "config/crucible-ts/library/foundry/signals.yaml",
211
+ );
212
+ const schemas = await resolver.list(["schemas/crucible-ts/**/*.schema.json"]);
213
+ ```
214
+
215
+ If you consume tsfulmen normally (npm / `node dist`), there is nothing to do — the default `auto` mode reads the on-disk asset trees. Building a compiled binary needs no special flags; the embedded modules are bundled automatically:
216
+
217
+ ```bash
218
+ bun build --compile ./your-app.ts --outfile your-app
219
+ ./your-app serve # signals catalog + metrics server resolve from embedded assets
220
+ ```
221
+
222
+ Force a backend with `TSFULMEN_ASSET_MODE` (`auto` | `fs` | `embedded`) when you need to (e.g. testing the embedded path locally).
223
+
224
+ > **Operator note**: the metrics `serve` HTTP server binds `127.0.0.1` (loopback) by default. Keep loopback unless you intentionally bind publicly (`--host 0.0.0.0`), in which case front it with authentication / rate-limiting.
225
+
226
+ See [Compile-safe SSOT assets](docs/development/compile-safe-assets.md) for the full guide.
227
+
199
228
  ### Application Identity
200
229
 
201
230
  Load application identity from `.fulmen/app.yaml` for vendor/app-specific configuration:
@@ -121,7 +121,7 @@ required:
121
121
  - version
122
122
  - metrics
123
123
  additionalProperties: false
124
- version: "0.4.14"
124
+ version: "0.4.15"
125
125
  defaults:
126
126
  histogram_buckets:
127
127
  ms_metrics: