@jhlagado/azm 0.2.12 → 0.2.14

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 (48) hide show
  1. package/dist/src/api-compile.d.ts +7 -1
  2. package/dist/src/api-compile.js +17 -5
  3. package/dist/src/api-register-contracts.js +69 -2
  4. package/dist/src/api-tooling.d.ts +1 -1
  5. package/dist/src/cli/artifact-files.d.ts +1 -0
  6. package/dist/src/cli/artifact-files.js +5 -0
  7. package/dist/src/cli/parse-args.d.ts +6 -1
  8. package/dist/src/cli/parse-args.js +59 -0
  9. package/dist/src/cli/run.js +2 -2
  10. package/dist/src/cli/usage.js +5 -0
  11. package/dist/src/cli/write-artifacts.d.ts +1 -1
  12. package/dist/src/cli/write-artifacts.js +15 -2
  13. package/dist/src/expansion/op-expansion.js +12 -1
  14. package/dist/src/index.d.ts +1 -1
  15. package/dist/src/outputs/types.d.ts +13 -1
  16. package/dist/src/register-contracts/analyze-helpers.d.ts +6 -1
  17. package/dist/src/register-contracts/analyze-helpers.js +67 -0
  18. package/dist/src/register-contracts/analyze.d.ts +8 -1
  19. package/dist/src/register-contracts/analyze.js +353 -16
  20. package/dist/src/register-contracts/interfaceContracts.js +45 -0
  21. package/dist/src/register-contracts/liveness.js +23 -0
  22. package/dist/src/register-contracts/policy.d.ts +2 -0
  23. package/dist/src/register-contracts/policy.js +54 -0
  24. package/dist/src/register-contracts/profiles.d.ts +5 -0
  25. package/dist/src/register-contracts/profiles.js +32 -2
  26. package/dist/src/register-contracts/programModel-boundaries.d.ts +5 -1
  27. package/dist/src/register-contracts/programModel-boundaries.js +20 -5
  28. package/dist/src/register-contracts/programModel-routines.js +37 -6
  29. package/dist/src/register-contracts/ratchet.d.ts +3 -0
  30. package/dist/src/register-contracts/ratchet.js +88 -0
  31. package/dist/src/register-contracts/report.d.ts +8 -1
  32. package/dist/src/register-contracts/report.js +174 -0
  33. package/dist/src/register-contracts/smartCommentParsing.js +22 -0
  34. package/dist/src/register-contracts/summaries.js +4 -0
  35. package/dist/src/register-contracts/summary-boundary.js +21 -3
  36. package/dist/src/register-contracts/summary.js +31 -3
  37. package/dist/src/register-contracts/tooling.d.ts +2 -1
  38. package/dist/src/register-contracts/tooling.js +2 -0
  39. package/dist/src/register-contracts/types.d.ts +159 -0
  40. package/dist/src/syntax/parse-line.js +3 -0
  41. package/docs/codebase/02-source-loading-and-parsing.md +10 -6
  42. package/docs/codebase/04-ops-and-register-contracts.md +58 -4
  43. package/docs/codebase/05-interfaces-and-output-artifacts.md +69 -6
  44. package/docs/codebase/06-verification-and-maintenance.md +10 -2
  45. package/docs/codebase/appendices/a-directory-file-reference.md +3 -1
  46. package/docs/codebase/appendices/b-compile-flow-reference.md +7 -5
  47. package/docs/codebase/appendices/c-public-surface-reference.md +19 -5
  48. package/package.json +1 -1
@@ -139,11 +139,13 @@ you need to find the owner of a behaviour quickly.
139
139
  | `carriers.ts` | Normalizes register contract carrier names and expands register pairs. |
140
140
  | `controlFlow.ts` | Successor logic for routine instruction flow. |
141
141
  | `profiles.ts` | Built-in external routine profiles such as MON-3. |
142
- | `report.ts` | Renders `.regcontracts.txt`, `.asmi` and compact source contract blocks. |
142
+ | `report.ts` | Renders text and JSON register-contract reports, inference exports, `.asmi` output and compact source contract blocks. |
143
143
  | `annotate.ts` | Inserts or replaces generated contract blocks near routine labels. |
144
144
  | `annotations.ts` | Builds source annotation artifact data. |
145
145
  | `fix.ts` | Finds and applies conservative expected-output fixes. |
146
146
  | `accept-output.ts` | Parses user-accepted output candidate options. |
147
+ | `policy.ts` | Resolves per-file strict, audit and off register-contract policy matches. |
148
+ | `ratchet.ts` | Compares current JSON findings against a baseline report. |
147
149
  | `tooling.ts` | Editor-friendly register contract diagnostics and code actions. |
148
150
  | `types.ts` | Register contract unit, routine, effect, summary, contract and report types. |
149
151
  | `sourceText.ts` | Source line splitting and joining helpers for text edits. |
@@ -23,7 +23,7 @@ compile(entryFile, options, deps)
23
23
  expand textual .include and tooling .import
24
24
  collect source texts
25
25
  collect source line comments
26
- attach source ownership metadata
26
+ attach source ownership metadata and unit ancestry
27
27
  scan logical lines
28
28
  read directive alias profiles
29
29
  build directive alias policy
@@ -43,7 +43,9 @@ compile(entryFile, options, deps)
43
43
  read AZMDoc and .asmi contracts
44
44
  infer summaries
45
45
  run liveness
46
- build report, interface and annotation artifacts
46
+ apply suppressions and scoped policy
47
+ compare JSON findings against optional baseline
48
+ build report, interface, inference and annotation artifacts
47
49
  assembleProgram()
48
50
  buildAddressState()
49
51
  emitProgramImage()
@@ -85,7 +87,7 @@ analyzeProgramNext(loaded)
85
87
 
86
88
  analyzeRegisterContractsForTools(loaded)
87
89
  run register contract analysis in audit-oriented tooling mode
88
- return candidate diagnostics and code actions
90
+ return findings, candidate diagnostics and code actions
89
91
  ```
90
92
 
91
93
  `analyzeRegisterCareForTools()` remains as a deprecated compatibility export for
@@ -97,8 +99,8 @@ tooling integrations that still use the older name.
97
99
  | ------------------ | -------------------- | ------------------------------------- |
98
100
  | Source loading | entry path | logical lines with ownership metadata, source texts, comments |
99
101
  | Parsing | logical lines | source items |
100
- | Analysis | source items | diagnostics, symbols |
101
- | Register contracts | loaded program | summaries, conflicts, reports |
102
+ | Analysis | source items | diagnostics, symbols, import-visibility checks |
103
+ | Register contracts | loaded program | summaries, findings, reports and inference artifacts |
102
104
  | Assembly | source items | byte map, symbols, source segments with per-item columns |
103
105
  | Outputs | byte map and symbols | artifacts |
104
106
  | CLI | artifacts | files on disk |
@@ -44,6 +44,16 @@ want one import path.
44
44
  Use this path for build tools, Debug80 integration and scripts that need bytes
45
45
  or artifacts.
46
46
 
47
+ Compile consumers should treat these register-contract options as public when
48
+ they use that subsystem:
49
+
50
+ - `registerContractsPolicy`
51
+ - `registerContractsReportFormat`
52
+ - `registerContractsBaseline`
53
+ - `registerContractsRatchet`
54
+ - `emitRegisterInference`
55
+ - `registerContractsInferenceFormat`
56
+
47
57
  ## Tooling Exports
48
58
 
49
59
  `@jhlagado/azm/tooling` exposes:
@@ -62,9 +72,10 @@ Use this path for editors, linters and language tooling.
62
72
  `analyzeRegisterCareForTools` remains as a deprecated compatibility export.
63
73
 
64
74
  Tooling consumers should treat parsed item spans as provenance-bearing data.
65
- When present, `sourceUnit` names the owning source unit and `sourceRelation`
66
- records whether that unit entered the load through `entry`, `include` or
67
- `import`.
75
+ When present, `sourceUnit` names the owning source unit, `sourceRelation`
76
+ records whether the physical file edge was `entry`, `include` or `import`, and
77
+ `sourceUnitRelation` records whether the owning unit entered the load through
78
+ `entry` or `import`.
68
79
 
69
80
  ## CLI Export
70
81
 
@@ -95,12 +106,15 @@ Treat these as public contracts:
95
106
  - `D8mSymbol`
96
107
  - `LoadedProgramNext`
97
108
  - `AnalyzeProgramNextResult`
109
+ - `RegisterContractsFinding`
110
+ - `RegisterContractsFindingKind`
111
+ - `RegisterContractsInferenceModel`
98
112
  - `RegisterContractsCandidateDiagnostic`
99
113
  - `RegisterContractsCodeAction`
100
114
 
101
115
  For tooling consumers, this contract also includes the optional
102
- `SourceSpan.sourceUnit` and `SourceSpan.sourceRelation` fields carried on parsed
103
- items.
116
+ `SourceSpan.sourceUnit`, `SourceSpan.sourceRelation` and
117
+ `SourceSpan.sourceUnitRelation` fields carried on parsed items.
104
118
 
105
119
  When these shapes change, update package tests, TypeScript type tests, README
106
120
  examples, repo-local reference docs and this manual.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jhlagado/azm",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "description": "AZM assembler for the Z80 family (Node.js CLI)",
5
5
  "license": "GPL-3.0-only",
6
6
  "engines": {