Skip to content

Commit fdb61d9

Browse files
committed
Add iso-canon package
1 parent 6a2f2ae commit fdb61d9

21 files changed

Lines changed: 1612 additions & 8 deletions

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ jobs:
6565
- workspace: "@razroo/iso-index"
6666
node: "20.6.0"
6767
extra: ""
68+
- workspace: "@razroo/iso-canon"
69+
node: "20.6.0"
70+
extra: ""
6871
- workspace: "@razroo/iso-migrate"
6972
node: "20.6.0"
7073
extra: ""
@@ -208,6 +211,12 @@ jobs:
208211
node packages/iso-index/dist/cli.js query --index /tmp/jobforge.iso-index.json --kind jobforge.report.url --key "url:https://example.test/jobs/123"
209212
node packages/iso-index/dist/cli.js verify --index /tmp/jobforge.iso-index.json
210213
214+
- name: iso-canon example normalize/compare
215+
run: |
216+
node packages/iso-canon/dist/cli.js normalize company "OpenAI, Inc." --config packages/iso-canon/examples/jobforge-canon.json --profile jobforge
217+
node packages/iso-canon/dist/cli.js key company-role --company "Anthropic, PBC" --role "Senior SWE, AI Platform - Remote US" --config packages/iso-canon/examples/jobforge-canon.json --profile jobforge
218+
node packages/iso-canon/dist/cli.js compare company "OpenAI, Inc." "Open AI" --config packages/iso-canon/examples/jobforge-canon.json --profile jobforge
219+
211220
- name: iso-migrate example plan/apply/check
212221
run: |
213222
mkdir -p /tmp/iso-migrate-smoke
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: iso-canon Release to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
defaults:
8+
run:
9+
working-directory: packages/iso-canon
10+
11+
jobs:
12+
publish:
13+
if: startsWith(github.ref_name, 'iso-canon-v')
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
checks: read
18+
id-token: write
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- uses: actions/setup-node@v6
23+
with:
24+
node-version: '22'
25+
registry-url: 'https://registry.npmjs.org'
26+
cache: 'npm'
27+
28+
- name: Set version from release tag
29+
run: |
30+
VERSION="${GITHUB_REF_NAME#iso-canon-v}"
31+
echo "VERSION=$VERSION" >> $GITHUB_ENV
32+
33+
- name: Verify required CI passed for release commit
34+
uses: ./.github/actions/verify-release-gate
35+
env:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Verify package.json version matches release tag
39+
run: npm run release:check-source -- "$VERSION"
40+
41+
- name: Install (workspace root)
42+
run: npm ci
43+
working-directory: .
44+
45+
- name: Publish to npm (with provenance)
46+
run: npm publish --provenance --access public
47+
env:
48+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

INTEGRATIONS.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Integrations
22

3-
This repo ships sixteen packages that **work on their own** but are **designed
3+
This repo ships seventeen packages that **work on their own** but are **designed
44
to compose**. The planned cross-package compositions listed here are already
55
shipped, so this file now serves as:
66

@@ -203,6 +203,19 @@ asking the model to hand-edit consumer-owned files.
203203

204204
---
205205

206+
## 14. `iso-canon` ← deterministic identity keys for domain packages — **DONE**
207+
208+
Introduced as a standalone package. `iso-canon` does not import JobForge,
209+
`iso-index`, `iso-ledger`, or any other domain package; it provides the
210+
on-disk JSON profile format and canonicalizer that domain tools can share.
211+
JobForge-style examples cover URL tracking cleanup, company legal suffixes,
212+
role aliases, and company-role dedupe keys, but the package remains generic:
213+
normalize URL/company/role/company-role identifiers and return explainable
214+
`same` / `possible` / `different` comparisons without asking the model to
215+
remember duplicate-matching rules.
216+
217+
---
218+
206219
## Design questions that are *not* open integrations
207220

208221
The following look like integrations but are deliberately decoupled —
@@ -252,6 +265,10 @@ don't "fix" them without a conversation first.
252265
It builds and verifies lookup records from configured sources. Domain
253266
packages still own which source wins when report, tracker, scan, cache,
254267
and ledger facts disagree, and when an index should be rebuilt.
268+
- **`iso-canon` does not decide duplicate policy for a domain.** It emits
269+
stable keys and explainable comparisons. Domain packages still own whether
270+
a `possible` match blocks work, warns, or routes to review, and which
271+
artifact source wins when canonical keys disagree with raw records.
255272
- **`iso-migrate` does not decide release policy for a domain.** It plans
256273
and applies idempotent file edits. Domain packages still own when
257274
migrations run, how versions map to migration catalogs, and which

README.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Codex, OpenCode) and stays legible across model tiers (frontier models down
1212
to 7B local models). The repo now covers the full loop: build portable
1313
harness files, route models, replay evals, parse production traces, scope
1414
role capabilities, select deterministic context bundles, audit runtime policy,
15-
cache reusable artifacts, migrate consumer projects, validate artifact contracts, and persist local workflow truth. The only narrower surface is `iso-trace model-score`, which still
15+
cache reusable artifacts, canonicalize identity keys, migrate consumer projects, validate artifact contracts, and persist local workflow truth. The only narrower surface is `iso-trace model-score`, which still
1616
depends on transcripts exposing stable model metadata.
1717

1818
Today, agent workflow reliability is fragmented on three axes:
@@ -27,11 +27,11 @@ Today, agent workflow reliability is fragmented on three axes:
2727
unstructured rationale all drop silently at 7B. You don't find out
2828
until the agent misbehaves in production.
2929
3. **Runtime fragmentation.** Workflows rely on fragile prompt prose for
30-
fan-out limits, context loading, artifact reuse, project upgrades, role permissions, output shape, duplicate checks, and
30+
fan-out limits, context loading, artifact reuse, identity keys, project upgrades, role permissions, output shape, duplicate checks, and
3131
"what already happened." Those invariants belong in deterministic local packages,
3232
not in repeatedly re-tokenized instructions.
3333

34-
Sixteen packages solve that in one pipeline with runtime control and a
34+
Seventeen packages solve that in one pipeline with runtime control and a
3535
feedback loop:
3636

3737
- **Four build-time tools** turn your authored source into every harness's file layout:
@@ -41,7 +41,7 @@ feedback loop:
4141
[`@razroo/iso-route`](./packages/iso-route) compiles *one model policy* into each harness's config.
4242
- **One wrapper** runs the whole build chain:
4343
[`@razroo/iso`](./packages/iso) chains the above into a single `iso build`.
44-
- **Eight runtime-control libraries** handle durable execution, context selection, artifact caching, artifact lookup, project migration, role capabilities, artifact shape, and operational truth:
44+
- **Nine runtime-control libraries** handle durable execution, context selection, artifact caching, artifact lookup, identity canonicalization, project migration, role capabilities, artifact shape, and operational truth:
4545
[`@razroo/iso-orchestrator`](./packages/iso-orchestrator) provides resumable
4646
steps, keyed mutexes, and bounded fan-out for side-effectful agent workflows,
4747
[`@razroo/iso-context`](./packages/iso-context) resolves context bundles,
@@ -50,6 +50,8 @@ feedback loop:
5050
content-addressed local artifacts with TTL-aware reads and pruning,
5151
[`@razroo/iso-index`](./packages/iso-index) builds and queries compact
5252
local indexes that point to authoritative facts across artifacts,
53+
[`@razroo/iso-canon`](./packages/iso-canon) produces stable URL,
54+
company, role, and company-role keys for duplicate checks,
5355
[`@razroo/iso-migrate`](./packages/iso-migrate) plans and applies
5456
idempotent consumer-project file migrations,
5557
[`@razroo/iso-capabilities`](./packages/iso-capabilities) resolves,
@@ -75,6 +77,7 @@ feedback loop:
7577
│ │ iso-context ─▶ context bundle plan
7678
│ │ iso-cache ─▶ artifact reuse
7779
│ │ iso-index ─▶ artifact lookup
80+
│ │ iso-canon ─▶ identity keys
7881
│ │ iso-migrate ─▶ project upgrades
7982
│ │ iso-capabilities ─▶ role permission policy
8083
┌────────────────────┐ │ .codex/config.toml │
@@ -129,6 +132,8 @@ the repo now supports a tighter loop:
129132
refetching or rederiving safe inputs on every run.
130133
- `iso-index build/query/has` keeps artifact lookup local instead of
131134
grepping and loading growing state/report trees into prompts.
135+
- `iso-canon normalize/key/compare` keeps duplicate/entity keys local
136+
instead of repeatedly restating URL, company, and role matching rules.
132137
- `iso-migrate plan/apply/check` keeps consumer project upgrades local
133138
instead of hand-editing package scripts, dependency ranges, and ignores.
134139
- `iso-capabilities check/render` keeps role permission matrices local
@@ -161,6 +166,9 @@ of the prompt:
161166
- `iso-index` makes artifact lookup executable: text/TSV/markdown-table/JSONL
162167
sources compile into a compact queryable index, so agents can ask where a
163168
fact lives without repeatedly grepping or loading growing files.
169+
- `iso-canon` makes identity canonicalization executable: URLs, companies,
170+
roles, and company-role pairs compile to stable keys with explainable
171+
`same` / `possible` / `different` comparisons.
164172
- `iso-migrate` makes project upgrades executable: JSON pointer edits, line
165173
insertion, exact replacement, and guarded file writes run as idempotent
166174
migrations instead of one-off shell patches.
@@ -268,6 +276,12 @@ of the prompt:
268276
authoritative facts without loading whole artifact trees into prompt
269277
context.
270278

279+
- **[`packages/iso-canon`](./packages/iso-canon)**[`@razroo/iso-canon`](https://www.npmjs.com/package/@razroo/iso-canon)
280+
Deterministic canonicalization and entity matching for agent workflows.
281+
Normalizes URLs, companies, roles, and company-role pairs into stable
282+
keys, then compares them with an explainable score so domain packages
283+
can keep duplicate checks out of prompt prose.
284+
271285
- **[`packages/iso-migrate`](./packages/iso-migrate)**[`@razroo/iso-migrate`](https://www.npmjs.com/package/@razroo/iso-migrate)
272286
Deterministic project migrations for agent workflow packages. Plans,
273287
applies, checks, and explains idempotent JSON/text file upgrades so
@@ -440,6 +454,15 @@ iso-index verify --index .iso-index.json
440454
iso-index explain --config index.json
441455
```
442456

457+
### `@razroo/iso-canon` — what stable key names this entity?
458+
459+
```bash
460+
iso-canon normalize url "https://www.example.com/jobs/123?utm_source=x"
461+
iso-canon key company-role --company "Anthropic, PBC" --role "Senior SWE - Remote US"
462+
iso-canon compare company "OpenAI, Inc." "Open AI" --config canon.json --profile jobforge
463+
iso-canon explain --config canon.json --profile jobforge
464+
```
465+
443466
### `@razroo/iso-migrate` — what project-owned files need upgrading?
444467

445468
```bash
@@ -488,6 +511,7 @@ iso/
488511
├── iso-context/ # deterministic context bundle policy
489512
├── iso-cache/ # deterministic content-addressed artifact cache
490513
├── iso-index/ # deterministic local artifact lookup index
514+
├── iso-canon/ # deterministic identity canonicalization
491515
├── iso-migrate/ # deterministic consumer project migrations
492516
├── iso-contract/ # deterministic artifact contracts
493517
└── iso-capabilities/ # deterministic role capability policy
@@ -510,6 +534,7 @@ npm --workspace @razroo/iso-ledger run test # iso-ledger event/state tests
510534
npm --workspace @razroo/iso-context run test # iso-context bundle/budget tests
511535
npm --workspace @razroo/iso-cache run test # iso-cache artifact cache tests
512536
npm --workspace @razroo/iso-index run test # iso-index artifact lookup tests
537+
npm --workspace @razroo/iso-canon run test # iso-canon identity key tests
513538
npm --workspace @razroo/iso-migrate run test # iso-migrate project migration tests
514539
npm --workspace @razroo/iso-contract run test # iso-contract artifact contract tests
515540
npm --workspace @razroo/iso-capabilities run test # iso-capabilities policy tests
@@ -548,7 +573,7 @@ build, and `npm publish --provenance`.
548573
## End-to-end example
549574

550575
[`examples/pipeline/`](./examples/pipeline) is an executable demonstration
551-
that exercises **seven of the sixteen packages end-to-end** in one `npm run
576+
that exercises **seven of the seventeen packages end-to-end** in one `npm run
552577
test:pipeline` invocation: `agentmd lint` + `render``isolint lint` →
553578
`iso-route build` (from a bundled `models.yaml` that extends the
554579
`standard` preset) → `iso-harness build` (which consumes iso-route's
@@ -567,7 +592,7 @@ downstream repo would use.
567592

568593
`npm run test:pack` goes one level further: it packs the local workspaces into
569594
tarballs, installs them into fresh temp projects, and smoke-tests the packaged
570-
`iso-harness`, `iso`, `iso-eval`, `iso-trace`, `iso-route`, `iso-guard`, `iso-ledger`, `iso-context`, `iso-cache`, `iso-index`, `iso-migrate`, `iso-contract`, and `iso-capabilities`
595+
`iso-harness`, `iso`, `iso-eval`, `iso-trace`, `iso-route`, `iso-guard`, `iso-ledger`, `iso-context`, `iso-cache`, `iso-index`, `iso-canon`, `iso-migrate`, `iso-contract`, and `iso-capabilities`
571596
CLIs. This guards against packaging regressions that workspace-only tests can
572597
miss.
573598

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/iso-canon/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# @razroo/iso-canon
2+
3+
## 0.1.0
4+
5+
- Initial release with deterministic URL, company, role, and company-role canonicalization.
6+
- Adds explainable entity comparison for duplicate checks and drift detection.
7+
- Ships a JobForge-style profile example and CLI smoke surface.

packages/iso-canon/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Razroo
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)