@altopelago/sansa 0.14.2 → 0.15.0-rc.3
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/CHANGELOG.md +133 -1
- package/README.md +98 -1
- package/conformance/README.md +8 -0
- package/conformance/aeonic-anchor-claims.json +133 -0
- package/conformance/aeonic-arithmetic-claims.json +60 -0
- package/conformance/aeonic-clock-claims.json +123 -0
- package/conformance/aeonic-comparison-claims.json +37 -0
- package/conformance/aeonic-datetime-claims.json +110 -0
- package/conformance/aeonic-rational-arithmetic-claims.json +72 -0
- package/conformance/aeonic-temporal-claims.json +105 -0
- package/conformance/cts-claims.json +17 -3
- package/conformance/results/aeonic-anchor-bounded-expansion-2026-11-24.json +39 -0
- package/conformance/results/aeonic-anchor-capacity-bounded-expansion-2026-11-24.json +452 -0
- package/conformance/results/aeonic-anchor-capacity-rc3-2026-11-24.json +452 -0
- package/conformance/results/aeonic-anchor-capacity.json +452 -0
- package/conformance/results/aeonic-anchor-rc3-2026-11-24.json +39 -0
- package/conformance/results/aeonic-anchor-snapshot-0.1.json +39 -0
- package/conformance/results/aeonic-arithmetic-snapshot-0.1.json +28 -0
- package/conformance/results/aeonic-clock-all-bounded-expansion-2026-11-24.json +49 -0
- package/conformance/results/aeonic-clock-all-rc3-2026-11-24.json +49 -0
- package/conformance/results/aeonic-clock-all-snapshot-0.1.json +49 -0
- package/conformance/results/aeonic-clock-arithmetic-bounded-expansion-2026-11-24.json +48 -0
- package/conformance/results/aeonic-clock-arithmetic-rc3-2026-11-24.json +48 -0
- package/conformance/results/aeonic-clock-arithmetic-snapshot-0.1.json +48 -0
- package/conformance/results/aeonic-clock-capacity-bounded-expansion-2026-11-24.json +326 -0
- package/conformance/results/aeonic-clock-capacity-rc3-2026-11-24.json +326 -0
- package/conformance/results/aeonic-clock-capacity.json +326 -0
- package/conformance/results/aeonic-clock-relations-bounded-expansion-2026-11-24.json +48 -0
- package/conformance/results/aeonic-clock-relations-rc3-2026-11-24.json +48 -0
- package/conformance/results/aeonic-clock-relations-snapshot-0.1.json +48 -0
- package/conformance/results/aeonic-comparison-snapshot-0.1.json +19 -0
- package/conformance/results/aeonic-datetime-all-bounded-expansion-2026-11-24.json +47 -0
- package/conformance/results/aeonic-datetime-all-rc3-2026-11-24.json +47 -0
- package/conformance/results/aeonic-datetime-all-snapshot-0.1.json +47 -0
- package/conformance/results/aeonic-datetime-arithmetic-bounded-expansion-2026-11-24.json +46 -0
- package/conformance/results/aeonic-datetime-arithmetic-rc3-2026-11-24.json +46 -0
- package/conformance/results/aeonic-datetime-arithmetic-snapshot-0.1.json +46 -0
- package/conformance/results/aeonic-datetime-capacity-bounded-expansion-2026-11-24.json +302 -0
- package/conformance/results/aeonic-datetime-capacity-rc3-2026-11-24.json +302 -0
- package/conformance/results/aeonic-datetime-capacity.json +302 -0
- package/conformance/results/aeonic-datetime-relations-bounded-expansion-2026-11-24.json +46 -0
- package/conformance/results/aeonic-datetime-relations-rc3-2026-11-24.json +46 -0
- package/conformance/results/aeonic-datetime-relations-snapshot-0.1.json +46 -0
- package/conformance/results/aeonic-rational-arithmetic-capacity.json +100 -0
- package/conformance/results/aeonic-rational-arithmetic-snapshot-0.2.json +30 -0
- package/conformance/results/aeonic-temporal-all-bounded-expansion-2026-11-24.json +39 -0
- package/conformance/results/aeonic-temporal-all-property-addressing-2026-11-16.json +39 -0
- package/conformance/results/aeonic-temporal-all-rc3-2026-11-24.json +39 -0
- package/conformance/results/aeonic-temporal-all-snapshot-0.1.json +39 -0
- package/conformance/results/aeonic-temporal-calendar-bounded-expansion-2026-11-24.json +38 -0
- package/conformance/results/aeonic-temporal-calendar-property-addressing-2026-11-16.json +38 -0
- package/conformance/results/aeonic-temporal-calendar-rc3-2026-11-24.json +38 -0
- package/conformance/results/aeonic-temporal-calendar-snapshot-0.1.json +38 -0
- package/conformance/results/aeonic-temporal-capacity-bounded-expansion-2026-11-24.json +136 -0
- package/conformance/results/aeonic-temporal-capacity-property-addressing-2026-11-16.json +136 -0
- package/conformance/results/aeonic-temporal-capacity-rc3-2026-11-24.json +136 -0
- package/conformance/results/aeonic-temporal-capacity.json +136 -0
- package/conformance/results/aeonic-temporal-relations-bounded-expansion-2026-11-24.json +38 -0
- package/conformance/results/aeonic-temporal-relations-property-addressing-2026-11-16.json +38 -0
- package/conformance/results/aeonic-temporal-relations-rc3-2026-11-24.json +38 -0
- package/conformance/results/aeonic-temporal-relations-snapshot-0.1.json +38 -0
- package/docs/aeonic-arithmetic.md +126 -0
- package/docs/aeonic-comparison.md +123 -0
- package/docs/aeonic-rational-arithmetic.md +167 -0
- package/docs/aeonic-temporal-civil-anchor.md +89 -0
- package/docs/aeonic-temporal-civil-clock.md +100 -0
- package/docs/aeonic-temporal-civil-date.md +124 -0
- package/docs/aeonic-temporal-civil-datetime.md +122 -0
- package/docs/api-contract.md +130 -3
- package/docs/capabilities.json +106 -2
- package/docs/child-identity-activation.md +93 -0
- package/docs/child-identity-candidate.md +60 -0
- package/docs/child-identity-tooling.md +31 -0
- package/docs/child-identity-workflows.md +102 -0
- package/docs/empty-keys-candidate.md +29 -0
- package/docs/migration-0.15.0.md +86 -0
- package/docs/property-addressing-implementation.md +118 -0
- package/docs/property-resolve-implementation.md +105 -0
- package/docs/property-selector-support.md +65 -0
- package/docs/property-selectors-api.d.ts +43 -0
- package/docs/property-selectors-api.pyi +27 -0
- package/docs/property-selectors-api.rs +48 -0
- package/docs/property-selectors-contract.md +168 -0
- package/docs/query-tool.md +32 -1
- package/docs/selector-cursor.md +45 -0
- package/docs/unicode-hardening.md +41 -0
- package/fixtures/address-v1.json +4 -3
- package/fixtures/child-identity-workflows/README.md +9 -0
- package/fixtures/child-identity-workflows/moved.aeon +10 -0
- package/fixtures/child-identity-workflows/original.aeon +10 -0
- package/fixtures/child-identity-workflows/reordered.aeon +10 -0
- package/fixtures/child-identity-workflows/replacement.aeon +10 -0
- package/fixtures/child-identity-workflows/workflows.json +89 -0
- package/fixtures/property-namespace-candidate-v1.json +336 -0
- package/fixtures/property-parser-candidate-v1.json +705 -0
- package/fixtures/property-query-candidate-v1.json +398 -0
- package/fixtures/property-resolve-candidate-v1.json +2702 -0
- package/fixtures/unicode-hardening-v1.json +401 -0
- package/package.json +30 -3
- package/scripts/calibrate-aeonic-anchor-capacity.py +294 -0
- package/scripts/calibrate-aeonic-clock-capacity.py +62 -0
- package/scripts/calibrate-aeonic-datetime-capacity.py +76 -0
- package/scripts/calibrate-aeonic-rational-capacity.py +85 -0
- package/scripts/calibrate-aeonic-temporal-capacity.py +95 -0
- package/scripts/cts-address.mjs +6 -2
- package/scripts/cts-aeonic-anchor.mjs +21 -0
- package/scripts/cts-aeonic-arithmetic-adapter.mjs +25 -0
- package/scripts/cts-aeonic-arithmetic.mjs +24 -0
- package/scripts/cts-aeonic-clock.mjs +24 -0
- package/scripts/cts-aeonic-comparison-adapter.mjs +30 -0
- package/scripts/cts-aeonic-comparison.mjs +25 -0
- package/scripts/cts-aeonic-datetime.mjs +24 -0
- package/scripts/cts-aeonic-rational-arithmetic-adapter.mjs +25 -0
- package/scripts/cts-aeonic-rational-arithmetic.mjs +24 -0
- package/scripts/cts-aeonic-temporal-civil-anchor-adapter.mjs +26 -0
- package/scripts/cts-aeonic-temporal-civil-clock-adapter.mjs +28 -0
- package/scripts/cts-aeonic-temporal-civil-date-adapter.mjs +28 -0
- package/scripts/cts-aeonic-temporal-civil-datetime-adapter.mjs +28 -0
- package/scripts/cts-aeonic-temporal.mjs +24 -0
- package/scripts/cts-instruction.mjs +4 -2
- package/scripts/cts-mutate.mjs +3 -2
- package/scripts/cts-resolve.mjs +17 -2
- package/scripts/playground.mjs +110 -0
- package/src/aeonic-arithmetic-binding.js +61 -0
- package/src/aeonic-arithmetic.d.ts +84 -0
- package/src/aeonic-arithmetic.js +276 -0
- package/src/aeonic-comparison.d.ts +86 -0
- package/src/aeonic-comparison.js +274 -0
- package/src/aeonic-convenience.d.ts +30 -0
- package/src/aeonic-convenience.js +45 -0
- package/src/aeonic-exact-number.js +34 -0
- package/src/aeonic-json.js +45 -0
- package/src/aeonic-rational-arithmetic.d.ts +86 -0
- package/src/aeonic-rational-arithmetic.js +417 -0
- package/src/aeonic-rational-json.js +51 -0
- package/src/aeonic-temporal-civil-anchor.d.ts +54 -0
- package/src/aeonic-temporal-civil-anchor.js +316 -0
- package/src/aeonic-temporal-civil-clock.d.ts +124 -0
- package/src/aeonic-temporal-civil-clock.js +388 -0
- package/src/aeonic-temporal-civil-date.d.ts +123 -0
- package/src/aeonic-temporal-civil-date.js +310 -0
- package/src/aeonic-temporal-civil-datetime.d.ts +138 -0
- package/src/aeonic-temporal-civil-datetime.js +501 -0
- package/src/index.d.ts +84 -1
- package/src/index.js +859 -190
- package/src/property-address.js +196 -0
- package/src/property-resolve.js +132 -0
- package/src/query-metadata.d.ts +16 -0
- package/src/query-metadata.js +25 -0
- package/src/selector-cursor.d.ts +19 -0
- package/src/selector-cursor.js +79 -0
- package/stress-tests/address/invalid.sansa-cases +0 -2
- package/stress-tests/address/valid.sansa-cases +3 -0
- package/tools/mutate-web/examples.mjs +1 -1
- package/tools/mutate-web/runtime.mjs +0 -2
- package/tools/playground/README.md +165 -0
- package/tools/playground/accessibility.js +91 -0
- package/tools/playground/aeon-highlight.js +77 -0
- package/tools/playground/aeon-source-composer.js +1077 -0
- package/tools/playground/anchor-examples.mjs +16 -0
- package/tools/playground/arithmetic-evaluator.mjs +28 -0
- package/tools/playground/arithmetic-model.mjs +187 -0
- package/tools/playground/arithmetic-worker.mjs +14 -0
- package/tools/playground/arithmetic.css +1 -0
- package/tools/playground/arithmetic.html +29 -0
- package/tools/playground/arithmetic.mjs +110 -0
- package/tools/playground/clock-examples.mjs +16 -0
- package/tools/playground/datetime-examples.mjs +22 -0
- package/tools/playground/examples.mjs +46 -0
- package/tools/playground/index.html +174 -0
- package/tools/playground/local.css +25 -0
- package/tools/playground/namespace.mjs +39 -0
- package/tools/playground/sansa-playground.js +1565 -0
- package/tools/playground/site.css +3914 -0
- package/tools/playground/temporal-examples.mjs +20 -0
- package/tools/playground/walkthrough.js +90 -0
- package/tools/playground/website-origin.json +16 -0
- package/tools/query-web/IDENTITY_SELECTORS.md +44 -0
- package/tools/query-web/app.js +4 -0
- package/tools/query-web/index.html +4 -0
- package/tools/query-web/runtime.mjs +70 -19
- package/tools/workflows/property-playground-assertions.mjs +33 -0
- package/tools/workflows/verify-child-identities.mjs +137 -0
- package/tools/workflows/verify-property-playground.mjs +48 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Aeonic rational arithmetic
|
|
2
|
+
|
|
3
|
+
SANSA's unreleased JavaScript API implements the complete
|
|
4
|
+
`aeonic-rational-arithmetic-cts-v1-snapshot-0.2` capability. Select
|
|
5
|
+
`aeonic.operations.arithmetic.rational.v1` explicitly in context or operation
|
|
6
|
+
policy. Its six operations are `add`, `subtract`, `multiply`, `divide`,
|
|
7
|
+
`quantize` and `materialize`. Snapshot compatibility preserves the specification's
|
|
8
|
+
proposal lifecycle and does not publish a package.
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
import {
|
|
12
|
+
evaluateAeonicRationalArithmetic as evaluate,
|
|
13
|
+
AEONIC_RATIONAL_ARITHMETIC_PROFILE as profile,
|
|
14
|
+
} from '@altopelago/sansa';
|
|
15
|
+
const number = value => ({ number: { category: 'finiteNumber', value } });
|
|
16
|
+
const context = { profile };
|
|
17
|
+
const third = evaluate({ operation: 'divide', input: {
|
|
18
|
+
left: number('1'), right: number('3'), context,
|
|
19
|
+
} });
|
|
20
|
+
if (third.outcome === 'value') {
|
|
21
|
+
// number: { category: 'exactRational', coefficient: '1', exponent: '0', denominator: '3' }
|
|
22
|
+
const whole = evaluate({ operation: 'multiply', input: {
|
|
23
|
+
left: third.value, right: number('3'), context,
|
|
24
|
+
} });
|
|
25
|
+
// whole is exact 1. A failed operation never supplies a value to chain.
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
All binary authored/derived pairings are supported. Derived rational values mean
|
|
30
|
+
`coefficient × 10^exponent / denominator`, using canonical integer text. The
|
|
31
|
+
positive denominator is reduced and coprime to ten; factors of two and five move
|
|
32
|
+
into the decimal part. One sixth is coefficient `5`, exponent `-1`, denominator
|
|
33
|
+
`3`. Finite results use the normalized `exactNumber` pair. Derived bundles require
|
|
34
|
+
`history: 'none-declared'` or `'approximation-declared'`; authored finite Number
|
|
35
|
+
bundles may omit history. These are internal mathematical values, not AEON
|
|
36
|
+
fraction literals. Authored Number spellings remain preserved at ingress.
|
|
37
|
+
|
|
38
|
+
Quantization requires a positive normalized finite increment and one explicit
|
|
39
|
+
mode: `half-even`, `half-away-from-zero`, `half-toward-zero`, `toward-zero`,
|
|
40
|
+
`away-from-zero`, `floor` or `ceiling`. The grid is integer multiples of that
|
|
41
|
+
increment through zero. Half-even is also known as bankers' rounding; it uses the
|
|
42
|
+
parity of the grid multiplier. No mode is supplied by the evaluator implicitly.
|
|
43
|
+
|
|
44
|
+
A changed quantized value reports `rounded-for-operands` and sets history to
|
|
45
|
+
`approximation-declared`. Unchanged quantization reports `exact-for-operands` and
|
|
46
|
+
preserves history. Subsequent exact calculations and cancellation to zero retain
|
|
47
|
+
any declared approximation. History is never inferred from spelling.
|
|
48
|
+
|
|
49
|
+
Materialization requires an explicit `integer`, `decimal` or `exponent` family
|
|
50
|
+
and preserves the value exactly. A fractional integer output or nonterminating
|
|
51
|
+
rational produces `unrepresentable_result`; quantize explicitly when desired.
|
|
52
|
+
Rational exponent materialization uses one leading mantissa digit, such as
|
|
53
|
+
`1.25e-1`. The separately pinned finite API retains its own rendering rules.
|
|
54
|
+
Calculated zero is unsigned; `zeroSign: 'negative'` selects negative-zero output.
|
|
55
|
+
Both zero/zero and nonzero/zero return `division_by_zero`. All diagnostics are
|
|
56
|
+
fail-closed and carry reason, stage and operation-local JSON pointer, without a
|
|
57
|
+
value. NaN, infinity, coercion, schema validation and Query expression syntax are
|
|
58
|
+
outside this capability.
|
|
59
|
+
|
|
60
|
+
## Ingress and capacities
|
|
61
|
+
|
|
62
|
+
`evaluateAeonicRationalArithmetic(request, options)` applies structured JSON byte
|
|
63
|
+
and depth admission. `evaluateAeonicRationalArithmeticText(requestText, options)`
|
|
64
|
+
keeps the original JSON text, including duplicate-key and byte distinctions.
|
|
65
|
+
Both are browser-compatible and have no Node Buffer dependency. Unsupported
|
|
66
|
+
native objects, nonfinite host numbers, nonscalar text and invalid trusted options
|
|
67
|
+
throw API errors rather than manufacturing operation diagnostics.
|
|
68
|
+
|
|
69
|
+
`options.resourceLimits` accepts named nonnegative safe integers:
|
|
70
|
+
|
|
71
|
+
| Limit | Default |
|
|
72
|
+
| --- | ---: |
|
|
73
|
+
| `maxRequestBytes` | 16,384 logical UTF-8 bytes |
|
|
74
|
+
| `maxRequestDepth` | 32 |
|
|
75
|
+
| `maxNumericCharacters` | 1,024 per operand or increment |
|
|
76
|
+
| `maxCoefficientDigits` | 512 |
|
|
77
|
+
| `maxDenominatorDigits` | 512 |
|
|
78
|
+
| `maxExponentMagnitude` | 1,000,000 |
|
|
79
|
+
| `maxWorkspaceDigits` | 4,096 |
|
|
80
|
+
| `maxOutputCharacters` | 1,024 |
|
|
81
|
+
|
|
82
|
+
`AEONIC_RATIONAL_ARITHMETIC_DEFAULT_RESOURCE_LIMITS` is frozen. Cancellation,
|
|
83
|
+
least-common-denominator admission, and compact on-grid/sub-unit shortcuts follow
|
|
84
|
+
the owning snapshot. Each operation gets its own limits; applications manage
|
|
85
|
+
whole-chain budgets. Selected maxima do not promise their Cartesian product or
|
|
86
|
+
machine-time/memory bounds. Structured JSON aliases count expanded bytes; cycles
|
|
87
|
+
fail closed. Native object-key enumeration occurs before child serialization;
|
|
88
|
+
getters/proxies/custom subclasses are not an untrusted-object sandbox. Outer CTS
|
|
89
|
+
transport and trusted executable limits remain separate.
|
|
90
|
+
|
|
91
|
+
## Calculate and materialize together
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
import { evaluateAeonicRationalArithmeticAndMaterialize } from '@altopelago/sansa';
|
|
95
|
+
const rounded = evaluateAeonicRationalArithmeticAndMaterialize({
|
|
96
|
+
operation: 'divide', input: { left: number('1'), right: number('3'), context },
|
|
97
|
+
}, {
|
|
98
|
+
family: 'decimal',
|
|
99
|
+
quantize: {
|
|
100
|
+
increment: { category: 'exactNumber', coefficient: '1', exponent: '-2' },
|
|
101
|
+
rounding: 'half-even',
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
// rounded.value.number.value === '0.33'; history === 'approximation-declared'.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The four convenience exports are `evaluateAeonicArithmeticAndMaterialize`,
|
|
108
|
+
`evaluateAeonicArithmeticAndMaterializeText`,
|
|
109
|
+
`evaluateAeonicRationalArithmeticAndMaterialize` and
|
|
110
|
+
`evaluateAeonicRationalArithmeticAndMaterializeText`. They compose the owning
|
|
111
|
+
finite/rational operations. A missing output object/own family is a `TypeError`.
|
|
112
|
+
Other output validation belongs to the operation reached. Rational quantization
|
|
113
|
+
runs only when its explicit `quantize` policy is present; finite output policies
|
|
114
|
+
reject that field. Profile defaults are not changed or retried after failure.
|
|
115
|
+
|
|
116
|
+
Success returns the final Number/history bundle and `metadata.steps`, each with
|
|
117
|
+
`step` and the original operation metadata. For rounded thirds the evaluations
|
|
118
|
+
are exact, rounded, exact. Failure stops immediately, adds `step` (calculation,
|
|
119
|
+
quantization or materialization) to the original diagnostic, and exposes no
|
|
120
|
+
partial value or successful-step metadata. Diagnostic stages/paths refer to that
|
|
121
|
+
step's logical request. Text variants forward the first calculation unchanged;
|
|
122
|
+
later requests use the native APIs, under the same options independently. The
|
|
123
|
+
finite native API has depth/operand/workspace guards rather than invented JSON
|
|
124
|
+
byte accounting. This application composition is separate from the closed frozen
|
|
125
|
+
operation result contract. Saving only a Number discards separate history unless
|
|
126
|
+
the application explicitly preserves it.
|
|
127
|
+
|
|
128
|
+
## Playground, conformance and provenance
|
|
129
|
+
|
|
130
|
+
Open the [arithmetic playground](../tools/playground/arithmetic.html) through
|
|
131
|
+
`npm run playground -- --aeon-root /path/to/built/aeon`, then choose **Arithmetic**.
|
|
132
|
+
Its eleven examples call SANSA's source text APIs in a fresh browser worker.
|
|
133
|
+
Continuations copy actual returned bundles; changing inputs or failures clears
|
|
134
|
+
reuse. Combined output configuration is a separate JSON editor. Original request
|
|
135
|
+
text and raw numerical policy tokens reach owning validation. The page bounds
|
|
136
|
+
request plus policy to 256 KiB, policy to 16 KiB/depth 8, results to 1 MiB and runs
|
|
137
|
+
to four seconds. Worker cancellation/timeouts are playground errors with no value,
|
|
138
|
+
not portable operation diagnostics. No trusted engine limit increases are exposed.
|
|
139
|
+
The launcher uses the existing built AEON checkout for Resolve/Query; arithmetic
|
|
140
|
+
itself imports only SANSA source. No Python runs in the browser.
|
|
141
|
+
|
|
142
|
+
Install the existing shared runner requirements, then use:
|
|
143
|
+
|
|
144
|
+
```sh
|
|
145
|
+
npm test
|
|
146
|
+
npm run cts:aeonic-rational-arithmetic
|
|
147
|
+
npm run cts:aeonic-rational-arithmetic:capacity
|
|
148
|
+
node scripts/validate-cts-claims.mjs --claims conformance/aeonic-rational-arithmetic-claims.json
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The [claim](../conformance/aeonic-rational-arithmetic-claims.json) records the full
|
|
152
|
+
frozen target, explicit selected map, actual report and independent default-capacity
|
|
153
|
+
probes. The driver uses `AEONITE_CTS_ROOT` (CTS `cts` directory),
|
|
154
|
+
`AEONITE_SPECS_ROOT`, `PYTHON`, and unique `--cts-root`, `--cts`, `--specs-root`,
|
|
155
|
+
`--report` arguments. An explicitly selected mutable manifest cannot establish
|
|
156
|
+
this snapshot claim. CI pins specs `d4801c7e4814af1ef6e51951c0af3f3d429f04fb`
|
|
157
|
+
and CTS `2ee51c88ad944a0f1c0951d5e39b298561c00c35` on Node 20, 22 and 24,
|
|
158
|
+
with TypeScript 5.9.3 consumer checks. Comparison/finite snapshots retain separate
|
|
159
|
+
claims. Rust, historical Query semantics and package publication remain separate.
|
|
160
|
+
|
|
161
|
+
The MIT-licensed rational implementation, token-preserving binding and convenience
|
|
162
|
+
composition adapt Aeonic commit `64347f19181041f86135e958da5a16ecc4b60b57`.
|
|
163
|
+
Copyright (c) 2026 Patrik; see [LICENSE](../LICENSE). Adaptation renames the SANSA
|
|
164
|
+
entry points, reuses existing exact-number/strict-JSON/trusted-binding helpers,
|
|
165
|
+
copies scalar-key ordering locally and replaces Node byte counting with bounded
|
|
166
|
+
portable UTF-8 counting. Numerical recipes and frozen contract bytes remain in
|
|
167
|
+
the owning specification/CTS repositories.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Civil date anchoring
|
|
2
|
+
|
|
3
|
+
`evaluateAeonicCivilAnchor` and `evaluateAeonicCivilAnchorText` implement the
|
|
4
|
+
complete `Aeonic.Operations.Temporal.CivilAnchor` capability against immutable
|
|
5
|
+
snapshot 0.1. Select `aeonic.operations.temporal.civil-anchor.v1` explicitly through
|
|
6
|
+
policy or a reusable context. These standalone JavaScript/TypeScript APIs do not
|
|
7
|
+
change Query temporal predicates or Rust behavior.
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import { evaluateAeonicCivilAnchor, evaluateAeonicCivilDateTime } from '@altopelago/sansa';
|
|
11
|
+
|
|
12
|
+
const anchored = evaluateAeonicCivilAnchor({
|
|
13
|
+
operation: 'anchor',
|
|
14
|
+
input: {
|
|
15
|
+
anchor: { temporal: { category: 'civilDate', value: '2024-02-28' } },
|
|
16
|
+
clock: {
|
|
17
|
+
temporal: { category: 'civilClockSet', pieces: [
|
|
18
|
+
{ kind: 'point', at: { day: '1', time: '01:30:00' } },
|
|
19
|
+
] },
|
|
20
|
+
originClockForm: 'second', history: 'approximation-declared',
|
|
21
|
+
},
|
|
22
|
+
context: { profile: 'aeonic.operations.temporal.civil-anchor.v1' },
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
// anchored.value.temporal.pieces[0].at === '2024-02-29T01:30:00'
|
|
26
|
+
if (anchored.outcome === 'value') {
|
|
27
|
+
const next = evaluateAeonicCivilDateTime({
|
|
28
|
+
operation: 'shiftClock',
|
|
29
|
+
input: {
|
|
30
|
+
value: anchored.value,
|
|
31
|
+
amount: { number: { category: 'finiteNumber', value: '0.2' } },
|
|
32
|
+
context: { profile: 'aeonic.operations.temporal.civil-datetime.v1' },
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
// Exact 2024-02-29T01:30:00.2 retains the declared approximation history.
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The anchor accepts an authored full date or a canonical derived date bundle
|
|
40
|
+
covering exactly one day. Coverage determines eligibility; original granularity
|
|
41
|
+
is history. Valid month/year anchors return `incompatible_operand`. Clocks accept
|
|
42
|
+
authored hour/minute/second forms or canonical nonempty exact point/interval sets.
|
|
43
|
+
Signed relative-day carry, arbitrary admitted finite fractional precision,
|
|
44
|
+
endpoint membership and gaps are preserved. A 100-day continuous interval stays
|
|
45
|
+
one interval. The result is an existing complete `civilDateTimeSet` bundle for
|
|
46
|
+
direct chaining under the receiving operation's explicitly selected profile.
|
|
47
|
+
|
|
48
|
+
Date origin and clamping history come from the anchor; clock origin and declared
|
|
49
|
+
approximation history come from the clock. The current operation is exact for
|
|
50
|
+
policy and applies no new clamping. Years remain 0001–9999. An exact excluded end
|
|
51
|
+
at the start of year 10000 uses the existing end-of-domain marker. Any covered
|
|
52
|
+
coordinate outside the domain rejects the whole operation without a partial value.
|
|
53
|
+
|
|
54
|
+
The native entry accepts JSON-shaped data. The text entry preserves duplicate-key
|
|
55
|
+
and raw numerical evidence. Trusted options accept `resourceLimits` and only the
|
|
56
|
+
complete `capabilities: ['anchoring']` selection. Eleven independent allowances
|
|
57
|
+
match the frozen contract. Work is anchor-range count plus clock-piece count;
|
|
58
|
+
intermediate candidates and successful output pieces each count clock pieces.
|
|
59
|
+
Work/candidate guards precede single-day eligibility; result-domain checks precede
|
|
60
|
+
output limits. Malformed trusted limits throw harness errors. Logical failures
|
|
61
|
+
return diagnostic reason/stage/path and never create values.
|
|
62
|
+
|
|
63
|
+
The Value operations playground includes **Date anchoring**, authored and derived
|
|
64
|
+
examples, dynamic descriptions, and explicit **Anchor this clock**, **Use as
|
|
65
|
+
anchor date** and **Shift as date-time** actions. Each prepares a request for
|
|
66
|
+
review without running automatically. Complete bundles retain both histories and
|
|
67
|
+
origins. The browser worker runs this checkout's source API.
|
|
68
|
+
|
|
69
|
+
`npm run cts:aeonic-anchor` defaults to frozen snapshot 0.1; `--cts-root`,
|
|
70
|
+
`--specs-root` and `--report` follow the existing drivers. Environment overrides
|
|
71
|
+
are `AEONITE_CTS_ROOT` (the CTS `cts` directory), `AEONITE_ANCHOR_SPECS_ROOT` and
|
|
72
|
+
fallback `AEONITE_SPECS_ROOT`; `PYTHON` selects the runner interpreter. An explicit
|
|
73
|
+
`--cts` can select mutable next, whose reports cannot make a stable snapshot claim.
|
|
74
|
+
|
|
75
|
+
[Claim and evidence](../conformance/aeonic-anchor-claims.json) retain all 234 genuine
|
|
76
|
+
case executions and complete assertions. `npm run cts:aeonic-anchor:capacity`
|
|
77
|
+
separately runs 26 native admission probes isolating all eleven defaults with
|
|
78
|
+
recorded companions. Admitted controls can reach later eligibility/domain
|
|
79
|
+
diagnostics; this evidence does not imply all admitted inputs produce values.
|
|
80
|
+
|
|
81
|
+
The implementation adapts MIT-licensed Aeonic at
|
|
82
|
+
`4efb42be227c1b1cd458a53155cebd51ffcc0154`: local imports/public names and bounded
|
|
83
|
+
UTF-8 counting for browser workers are the adaptations. Previous engines,
|
|
84
|
+
selectors, defaults and Query predicates retain their meanings. Native graph
|
|
85
|
+
walks reject cycles and bound shared expansion by logical admission; eager key
|
|
86
|
+
inventory, accessors/proxies/subclasses, outer framing, browser preparation,
|
|
87
|
+
heap/disk, combined capacity and chain budgets remain separate host concerns.
|
|
88
|
+
Timezone/WTC, leap/UTC realization, elapsed-time authority and release publication
|
|
89
|
+
are outside this source implementation claim.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Aeonic standalone civil clocks
|
|
2
|
+
|
|
3
|
+
The unreleased JavaScript/TypeScript API implements immutable civil-clock
|
|
4
|
+
snapshot 0.1. Select `aeonic.operations.temporal.civil-clock.v1` explicitly through
|
|
5
|
+
policy or context. Relations (`equal`, `compare`, `relate`) and Arithmetic
|
|
6
|
+
(`shiftClock`, `step`, `materialize`) are independently complete capabilities.
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
import { evaluateAeonicCivilClock, AEONIC_TEMPORAL_CIVIL_CLOCK_PROFILE as profile }
|
|
10
|
+
from '@altopelago/sansa';
|
|
11
|
+
|
|
12
|
+
const moved = evaluateAeonicCivilClock({ operation: 'shiftClock', input: {
|
|
13
|
+
context: { profile },
|
|
14
|
+
value: { temporal: { category: 'civilClock', value: '23:30:00' } },
|
|
15
|
+
amount: { number: { category: 'finiteNumber', value: '7200' } },
|
|
16
|
+
} });
|
|
17
|
+
// moved.value.temporal.pieces[0].at: { day: '1', time: '01:30:00' }
|
|
18
|
+
|
|
19
|
+
if (moved.outcome === 'value') {
|
|
20
|
+
const output = evaluateAeonicCivilClock({ operation: 'materialize', input: {
|
|
21
|
+
context: { profile }, value: moved.value, policy: { clockForm: 'second' },
|
|
22
|
+
} });
|
|
23
|
+
// unrepresentable_result: a bare clock cannot discard day +1.
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Reuse the entire returned `value` bundle for chaining. Authored `HH:`, `HH:MM`
|
|
28
|
+
and `HH:MM:SS[.fraction]` have reference day `0`, with no calendar date. Hour and
|
|
29
|
+
minute forms cover complete half-open intervals; second forms identify exact
|
|
30
|
+
coordinates. Relative days participate in equality, so day +1 at 01:30 differs
|
|
31
|
+
from authored day-zero 01:30. Negative coordinates use mathematical floor:
|
|
32
|
+
midnight minus 0.5 seconds is day -1 at 23:59:59.5.
|
|
33
|
+
|
|
34
|
+
Derived bundles contain `temporal: {category:'civilClockSet', pieces:[...]}`,
|
|
35
|
+
`originClockForm` and `history`. A point is `{kind:'point', at:{day:'1',
|
|
36
|
+
time:'01:30:00'}}`; an interval has `start`, `end`, `includeStart` and `includeEnd`.
|
|
37
|
+
Coordinates use canonical integer day text and full clock text, trimming trailing
|
|
38
|
+
fractional zeroes. Nonempty sets must be sorted without overlaps, redundant
|
|
39
|
+
points or mergeable neighbors. Gaps and excluded boundaries stay exact; a single
|
|
40
|
+
interval can span days without enumerating them.
|
|
41
|
+
|
|
42
|
+
`shiftClock` accepts exact finite-decimal seconds as an authored Number or a
|
|
43
|
+
normalized derived decimal bundle. Nonterminating rational amounts require
|
|
44
|
+
explicit quantization first. `step` requires an entire selected hour/minute/second
|
|
45
|
+
form and a canonical signed integer-text `count`. `materialize` requires an
|
|
46
|
+
explicit `clockForm`, exact coverage and a starting day of zero; the last hour
|
|
47
|
+
can end at excluded day +1 midnight. Neither operation wraps away carry.
|
|
48
|
+
|
|
49
|
+
Relations return symbols for exact equality, whole-set chronology or set
|
|
50
|
+
containment/overlap/disjointness. Clock-origin metadata is descriptive; history
|
|
51
|
+
is a sticky `none-declared` or `approximation-declared` marker. Previously rounded
|
|
52
|
+
amounts propagate that marker even when the current shift is exact or zero.
|
|
53
|
+
No clamping field or measurement interval is inferred. Diagnostics produce no
|
|
54
|
+
value; bare clock text cannot preserve separate origin/history metadata.
|
|
55
|
+
|
|
56
|
+
`evaluateAeonicCivilClockText` takes verbatim logical JSON, retaining duplicate-key
|
|
57
|
+
and raw-number evidence. The native API takes JSON caller data. Trusted options
|
|
58
|
+
contain `resourceLimits` and/or `capabilities` (`relations`, `arithmetic` or both).
|
|
59
|
+
Malformed trusted options throw host errors; logical failures return staged
|
|
60
|
+
diagnostics. The exported `AEONIC_TEMPORAL_CIVIL_CLOCK_DEFAULT_RESOURCE_LIMITS`
|
|
61
|
+
contains all sixteen defaults. Separate limits cover request bytes/depth, text,
|
|
62
|
+
input/intermediate/output pieces, work, precision, day digits, numerical dimensions,
|
|
63
|
+
output characters and successful result bytes. Limits never trigger rounding,
|
|
64
|
+
clipping, partial values or automatic error-to-value conversion.
|
|
65
|
+
|
|
66
|
+
Native JSON graph admission bounds shared-subtree unfolding and rejects cycles.
|
|
67
|
+
Arbitrary accessors/proxies/subclasses, eager key enumeration, outer STDIO
|
|
68
|
+
framing, OS heap/process/disk and whole-chain budgets remain host concerns.
|
|
69
|
+
The 34 isolated native-default capacity probes use recorded companion limits;
|
|
70
|
+
they do not guarantee their Cartesian product or a general memory sandbox.
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
npm run cts:aeonic-clock
|
|
74
|
+
npm run cts:aeonic-clock -- --capability-set relations
|
|
75
|
+
npm run cts:aeonic-clock -- --capability-set arithmetic
|
|
76
|
+
npm run cts:aeonic-clock:capacity
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Matching CTS/specification roots and Python JSON Schema dependencies are required.
|
|
80
|
+
`AEONITE_CTS_ROOT` points to the CTS `cts/` directory;
|
|
81
|
+
`AEONITE_CLOCK_SPECS_ROOT` (or the generic `AEONITE_SPECS_ROOT`) selects specs.
|
|
82
|
+
The driver also accepts `--cts-root`, `--specs-root`, `--cts` and `--report`.
|
|
83
|
+
Selecting one capability also restricts the provider to that complete group.
|
|
84
|
+
Current pins/reports are in `conformance/aeonic-clock-claims.json`.
|
|
85
|
+
|
|
86
|
+
The **Civil clocks** value-playground lane runs the actual source API in a browser
|
|
87
|
+
worker. Nine examples cover carry/borrow, cross-midnight intervals, stepping,
|
|
88
|
+
materialization, day-sensitive equality, containment and approximation history.
|
|
89
|
+
Descriptions follow edited inputs. Continuations clone the complete bundle;
|
|
90
|
+
symbols and diagnostics cannot be reused as clocks. A 256 KiB input limit,
|
|
91
|
+
4-second timeout and 1 MiB result limit are application controls separate from
|
|
92
|
+
semantic operation allowances. Browser preparation/display and worker termination
|
|
93
|
+
are application concerns, not whole-process memory guarantees.
|
|
94
|
+
|
|
95
|
+
Adapted from the MIT-licensed Aeonic engine at
|
|
96
|
+
`8cb31dd3beb44d758ed27c02600b5b4c858fc2a1`, with local imports, SANSA public names
|
|
97
|
+
and a bounded scalar UTF-8 counter for browser compatibility. This adds no Query
|
|
98
|
+
invocation, Rust port, date anchoring, timezone/WTC/leap resolution, elapsed-time
|
|
99
|
+
authority, package release or website deployment. Existing temporal/numerical
|
|
100
|
+
profiles keep their meanings and defaults.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Aeonic civil-date operations
|
|
2
|
+
|
|
3
|
+
Unreleased JavaScript APIs consume immutable civil-date snapshot 0.1. Relations
|
|
4
|
+
(`equal`, `compare`, `relate`) and Calendar (`shift`, `step`, `materialize`) are
|
|
5
|
+
independently complete capabilities sharing exact date bundles. Select
|
|
6
|
+
`aeonic.operations.temporal.civil-date.v1` explicitly through context or policy.
|
|
7
|
+
Dates use the proleptic Gregorian calendar within years 0001–9999.
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import {
|
|
11
|
+
evaluateAeonicTemporal as evaluate,
|
|
12
|
+
AEONIC_TEMPORAL_CIVIL_DATE_PROFILE as profile,
|
|
13
|
+
} from '@altopelago/sansa';
|
|
14
|
+
const context = { profile };
|
|
15
|
+
const first = evaluate({ operation: 'shift', input: {
|
|
16
|
+
value: { temporal: { category: 'civilDate', value: '2024-02' } },
|
|
17
|
+
context, policy: { unit: 'month', count: '1' },
|
|
18
|
+
} });
|
|
19
|
+
if (first.outcome === 'value') {
|
|
20
|
+
// Precise coverage is March 1–29; the complete bundle carries origin/history.
|
|
21
|
+
const second = evaluate({ operation: 'shift', input: {
|
|
22
|
+
value: first.value, context, policy: { unit: 'month', count: '1' },
|
|
23
|
+
} });
|
|
24
|
+
// Exact coverage is April 1–29, without silently adding March 30–31.
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`evaluateAeonicTemporal(request, options)` admits structured JSON with logical
|
|
29
|
+
byte/depth bounds. `evaluateAeonicTemporalText(text, options)` takes verbatim
|
|
30
|
+
scalar JSON, retaining duplicate keys and malformed numeric token widths for
|
|
31
|
+
staged validation. Authored dates are `YYYY-`, `YYYY-MM`, or `YYYY-MM-DD`.
|
|
32
|
+
|
|
33
|
+
An authored bundle has `temporal: {category: 'civilDate', value: '2024-03'}`;
|
|
34
|
+
its optional origin defaults to authored granularity and history to
|
|
35
|
+
`none-declared`. Derived bundles require both `originGranularity` (day/month/year/
|
|
36
|
+
undeclared) and `history` (none-declared/clamping-declared):
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
const dates = {
|
|
40
|
+
temporal: { category: 'civilDateSet', ranges: [
|
|
41
|
+
{ start: '2024-03-01', end: '2024-03-29' },
|
|
42
|
+
] },
|
|
43
|
+
originGranularity: 'month', history: 'none-declared',
|
|
44
|
+
};
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Derived ranges must be nonempty, sorted, inclusive full-date ranges, disjoint
|
|
48
|
+
and nonadjacent. Their precise coverage is authoritative for chaining. Origin
|
|
49
|
+
is descriptive; it does not turn a partial range into a whole period.
|
|
50
|
+
|
|
51
|
+
## Explicit operations
|
|
52
|
+
|
|
53
|
+
- `shift` requires `unit` (day/month/year/eom/eoy) and canonical signed whole-number
|
|
54
|
+
text `count`. Ordinary month/year shifts preserve the day where possible and
|
|
55
|
+
clamp once at the target. EOM/EOY preserve distance from period end and clamp
|
|
56
|
+
at the target period's start. One two-month shift can differ from two one-month
|
|
57
|
+
shifts. Current clamping is separate from sticky prior clamping history.
|
|
58
|
+
- `step` requires `granularity` (day/month/year) and `count`. Input must exactly
|
|
59
|
+
cover one complete selected period. Stepping February as a month gives all of
|
|
60
|
+
March; a derived March 1–29 cannot step as a month.
|
|
61
|
+
- `materialize` requires `granularity` and succeeds only for one complete matching
|
|
62
|
+
day/month/year. It returns an authored-date descriptor together with origin
|
|
63
|
+
and history. A containing-period display cannot substitute for exact output.
|
|
64
|
+
- `equal` compares exact covered date sets and returns `|equal|` or `|notEqual|`.
|
|
65
|
+
- `compare` returns `|before|` or `|after|` only when all dates of one set precede
|
|
66
|
+
all dates of the other, `|equal|` for identical sets, and `|indeterminate|`
|
|
67
|
+
otherwise. It supplies no total sorting order.
|
|
68
|
+
- `relate` returns `|equal|`, `|contains|`, `|containedBy|`, `|overlaps|`, or
|
|
69
|
+
`|disjoint|`; containment is strict. A year contains one of its days but the
|
|
70
|
+
two sets are not equal. Relation results are symbols and cannot feed date
|
|
71
|
+
operations. Relation metadata retains separate left/right histories.
|
|
72
|
+
|
|
73
|
+
Diagnostics contain no value. Configuration/operand/availability and resource
|
|
74
|
+
precedence follow the frozen contract. Domain overflow rejects the entire result,
|
|
75
|
+
including when only part of the source set would remain in range. No automatic
|
|
76
|
+
null value, Boolean predicate, rounding or lossy materialization is introduced.
|
|
77
|
+
|
|
78
|
+
## Limits and verification
|
|
79
|
+
|
|
80
|
+
Trusted `options.resourceLimits` selects nonnegative safe integers for eight
|
|
81
|
+
independent per-operation dimensions: request bytes/depth, input ranges, count
|
|
82
|
+
characters, output ranges, calendar work, emitted text and successful-envelope
|
|
83
|
+
bytes. `options.capabilities` may restrict the provider to `['relations']` or
|
|
84
|
+
`['calendar']`; its default exposes both. Claim selection and provider capability
|
|
85
|
+
are distinct. Limits never return partial or widened values.
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
npm run cts:aeonic-temporal
|
|
89
|
+
npm run cts:aeonic-temporal -- --capability-set relations
|
|
90
|
+
npm run cts:aeonic-temporal -- --capability-set calendar
|
|
91
|
+
npm run cts:aeonic-temporal:capacity
|
|
92
|
+
node scripts/validate-cts-claims.mjs --claims conformance/aeonic-temporal-claims.json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Set `AEONITE_CTS_ROOT` to the CTS `cts/` directory and
|
|
96
|
+
`AEONITE_TEMPORAL_SPECS_ROOT` (or `AEONITE_SPECS_ROOT`) to the specs repository;
|
|
97
|
+
explicit driver flags take precedence. `PYTHON` selects the Python 3.9+ shared
|
|
98
|
+
runner executable. The driver selects frozen snapshot 0.1 explicitly. `--cts`
|
|
99
|
+
may select a different manifest for investigation; such a run does not replace
|
|
100
|
+
the claimed snapshot. The [claim](../conformance/aeonic-temporal-claims.json)
|
|
101
|
+
pins exact specification/CTS/implementation fingerprints and actual reports.
|
|
102
|
+
Combined execution passes 296 calls/310 assertions; independently restricted
|
|
103
|
+
Relations passes 171/185 and Calendar 125/125. All 18 independent default-capacity
|
|
104
|
+
probes pass. Selected dimensions/companions do not promise their Cartesian
|
|
105
|
+
product, whole-chain budgets or machine-time/heap limits. Native getters/proxies,
|
|
106
|
+
key enumeration and complete STDIO framing remain separate host boundaries.
|
|
107
|
+
|
|
108
|
+
## Playground and ownership
|
|
109
|
+
|
|
110
|
+
Open **Arithmetic & civil dates** from `npm run playground`, then choose
|
|
111
|
+
**Civil dates · snapshot 0.1**. Twelve examples run the local source API in a
|
|
112
|
+
browser worker. Continuations copy complete date bundles and require explicit
|
|
113
|
+
shift/step/materialization. The live description follows edited request JSON;
|
|
114
|
+
starting-example prose remains separately labeled. Symbols and diagnostics have
|
|
115
|
+
no date continuation. Numerical convenience output policies are unavailable
|
|
116
|
+
for temporal operations. Existing worker input/output/time guards still apply.
|
|
117
|
+
|
|
118
|
+
The engine, CTS adapter, default-capacity probes and starting examples adapt
|
|
119
|
+
MIT-licensed Aeonic commit `627219ac90fdd09d17bfd0a3c25db717305d1d0f`. Imports and
|
|
120
|
+
public names follow SANSA conventions; bounded UTF-8 counting replaces Node
|
|
121
|
+
Buffer calls so the engine runs in browser workers. Existing strict JSON/token
|
|
122
|
+
helpers are reused. Normative source and CTS ownership remain in `aeonite-org`.
|
|
123
|
+
Query's older temporal completion-set APIs, Rust, clocks/timezones/WTC/database
|
|
124
|
+
resolution and package publication retain their separate capability boundaries.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Aeonic civil date-time operations
|
|
2
|
+
|
|
3
|
+
The standalone JavaScript API implements immutable civil date-time snapshot 0.1.
|
|
4
|
+
Select `aeonic.operations.temporal.civil-datetime.v1` through policy or context;
|
|
5
|
+
operand shape never selects it automatically. Relations and Arithmetic are
|
|
6
|
+
independently complete capabilities. Existing Query temporal behavior is separate.
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
import { evaluateAeonicCivilDateTime, AEONIC_TEMPORAL_CIVIL_DATETIME_PROFILE as profile } from '@altopelago/sansa';
|
|
10
|
+
|
|
11
|
+
const shifted = evaluateAeonicCivilDateTime({
|
|
12
|
+
operation: 'shift',
|
|
13
|
+
input: {
|
|
14
|
+
value: { temporal: { category: 'civilDateTime', value: '2024-02T09:30' } },
|
|
15
|
+
context: { profile },
|
|
16
|
+
policy: { unit: 'month', count: '1' },
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
// Exact daily minute intervals on March 1–29, preserving both origins/histories.
|
|
20
|
+
if (shifted.outcome === 'value') {
|
|
21
|
+
const moved = evaluateAeonicCivilDateTime({
|
|
22
|
+
operation: 'shiftClock',
|
|
23
|
+
input: {
|
|
24
|
+
value: shifted.value,
|
|
25
|
+
context: { profile },
|
|
26
|
+
amount: { number: { category: 'finiteNumber', value: '0.2' } },
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`evaluateAeonicCivilDateTimeText(requestText, options)` accepts verbatim logical
|
|
33
|
+
JSON, retaining duplicate-key and raw-number evidence for validation. The native
|
|
34
|
+
API accepts JSON graphs; finite authored Number text and normalized exact-decimal
|
|
35
|
+
bundles can supply clock amounts, including results from numerical calculations.
|
|
36
|
+
Nonterminating rational amounts require explicit quantization first.
|
|
37
|
+
|
|
38
|
+
Authored values may have year/month/day date granularity and hour/minute/second
|
|
39
|
+
clock form. Hour and minute forms cover intervals with excluded upper endpoints;
|
|
40
|
+
second forms identify exact coordinates, including resource-bounded decimal
|
|
41
|
+
fractions. Reduced dates preserve all compatible dates. Seconds 60, timezone
|
|
42
|
+
suffixes, offsets and WTC contexts are outside this profile. Years are 0001–9999.
|
|
43
|
+
|
|
44
|
+
Derived `civilDateTimeSet` descriptors contain nonempty canonical `pieces`:
|
|
45
|
+
`{kind:'point', at:'2024-03-01T09:30:00'}` or
|
|
46
|
+
`{kind:'interval', start:..., end:..., includeStart:true, includeEnd:false}`.
|
|
47
|
+
Coordinates use canonical full unzoned date-time text, with trailing fractional
|
|
48
|
+
zeroes removed. Pieces are sorted without overlap, redundant points or mergeable
|
|
49
|
+
neighbors. A shared excluded boundary stays missing. The final excluded interval
|
|
50
|
+
end may be `{boundary:'endOfDomain'}`; it never admits year 10000 as a value.
|
|
51
|
+
|
|
52
|
+
Each derived bundle requires `originDateGranularity`, `originClockForm` and
|
|
53
|
+
`history: {clamping, approximation}`. Origins are descriptive and may be
|
|
54
|
+
`undeclared`; they do not widen coverage. History markers are independently
|
|
55
|
+
sticky. Current-operation clamping is separate, and every successful operation
|
|
56
|
+
is exact under its selected policy. Approximation history propagates from a
|
|
57
|
+
previously rounded clock amount without creating an uncertainty interval.
|
|
58
|
+
|
|
59
|
+
- `equal`, `compare` and `relate` return symbols. Chronology uses whole-set
|
|
60
|
+
before/after/equal/indeterminate; exact set relations distinguish strict
|
|
61
|
+
containment, overlap and disjointness, respecting excluded endpoints.
|
|
62
|
+
- `shift` uses a signed canonical whole-number `count` and explicit `unit`:
|
|
63
|
+
day, month, year, EOM or EOY (`eom`/`eoy`). Calendar rules apply pointwise to
|
|
64
|
+
dates while retaining clock subsets. A multi-unit shift clamps once.
|
|
65
|
+
- `shiftClock` adds exact signed finite-decimal civil-coordinate seconds. This
|
|
66
|
+
ordinary civil clock has 24 hours per day and makes no elapsed-time claim.
|
|
67
|
+
- `step` requires complete coverage matching explicitly selected
|
|
68
|
+
`dateGranularity` and `clockForm`, plus a whole-number `count`. Stepping the
|
|
69
|
+
February month/minute form produces all of March; shifting February produces
|
|
70
|
+
only March 1–29 in 2024.
|
|
71
|
+
- `materialize` requires both selectors and an exact extent match. It returns
|
|
72
|
+
an authored representation with origins/history together. Partial March
|
|
73
|
+
coverage cannot silently become a whole-March literal.
|
|
74
|
+
|
|
75
|
+
Diagnostics have no value. Preserve complete returned bundles for chaining;
|
|
76
|
+
saving only bare date-time text loses origins/history. Materialization never
|
|
77
|
+
implicitly approximates, widens or discards gaps.
|
|
78
|
+
|
|
79
|
+
Trusted options accept `resourceLimits` and `capabilities` (`relations` and/or
|
|
80
|
+
`arithmetic`). Malformed trusted configuration throws; logical request failures
|
|
81
|
+
return staged diagnostics. Default capacities are exported as
|
|
82
|
+
`AEONIC_TEMPORAL_CIVIL_DATETIME_DEFAULT_RESOURCE_LIMITS`. Admission separately
|
|
83
|
+
limits request bytes/depth, coordinate text, input/intermediate/output pieces,
|
|
84
|
+
work, fractional precision, counts, numeric dimensions, output text and result
|
|
85
|
+
bytes. Matching budgets guard complete-form eligibility checks. Each operation
|
|
86
|
+
has its own budget; applications manage entire chains.
|
|
87
|
+
|
|
88
|
+
Native support is for JSON caller data. Arbitrary accessors, proxies, custom
|
|
89
|
+
subclasses, eager key enumeration, outer STDIO framing and process/heap limits
|
|
90
|
+
remain host concerns. Selected capacity boundaries do not guarantee their
|
|
91
|
+
Cartesian product or a memory sandbox.
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
npm run cts:aeonic-datetime
|
|
95
|
+
npm run cts:aeonic-datetime -- --capability-set relations
|
|
96
|
+
npm run cts:aeonic-datetime -- --capability-set arithmetic
|
|
97
|
+
npm run cts:aeonic-datetime:capacity
|
|
98
|
+
node scripts/validate-cts-claims.mjs --claims conformance/aeonic-datetime-claims.json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
For nonstandard checkout layouts, set `AEONITE_CTS_ROOT` to the CTS `cts/`
|
|
102
|
+
directory and `AEONITE_DATETIME_SPECS_ROOT` to the source repository, or use
|
|
103
|
+
`--cts-root`/`--specs-root`. The fallback source variable is `AEONITE_SPECS_ROOT`.
|
|
104
|
+
`--cts` explicitly overrides the manifest; it does not promote a mutable run
|
|
105
|
+
into the claimed snapshot. `PYTHON` chooses the shared runner interpreter.
|
|
106
|
+
|
|
107
|
+
CI pins specification `75b8dbd33ead7f5f9a90714981d80529a72ec339` and CTS
|
|
108
|
+
`7b1e229a08d86ab6fcc91e1724a4252339849e70`, verifies full and restricted
|
|
109
|
+
providers, and probes native capacities. The [claim](../conformance/aeonic-datetime-claims.json)
|
|
110
|
+
retains actual reports, limits and exact source/helper/implementation fingerprints.
|
|
111
|
+
The adapted engine originates at Aeonic
|
|
112
|
+
`a4b3391dc678d2cc441fe661cfa669bc969086b9` under MIT. Local imports/names and a
|
|
113
|
+
bounded scalar UTF-8 counter support browser workers; temporal semantics retain
|
|
114
|
+
the source behavior. Existing strict JSON/raw-number helpers are reused.
|
|
115
|
+
|
|
116
|
+
Run `npm run playground`, then open **Value operations → Civil date-times**.
|
|
117
|
+
Examples cover reduced precision, excluded endpoints, exact clock carry,
|
|
118
|
+
clamping gaps, complete-period stepping, materialization and both histories.
|
|
119
|
+
Descriptions follow edited JSON. Continuations copy full bundles and require
|
|
120
|
+
reviewing explicit policies before running. Worker input/output/time controls
|
|
121
|
+
are independent application limits. Query integration, Rust, timezone/WTC and
|
|
122
|
+
package publication remain separate.
|