Skip to content

Commit f14a732

Browse files
committed
docs(adr): ADR-0144 and the ADR-0104 note cite symbols, not line numbers
check:adr-symbol-anchors refuses a line number as an anchor form; the readings now anchor to the declaring symbol or the file. Claude-Session: https://claude.ai/code/session_01Utp6CbTZrFqRYNgjSaSbN5 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 44927ce commit f14a732

2 files changed

Lines changed: 22 additions & 21 deletions

File tree

‎docs/adr/0104-field-runtime-value-shape-contract.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,9 @@ inert metadata ADR-0078 forbids.
174174
> This paragraph's currency sentence needs two corrections.
175175
> First, the deletion it records has not happened yet. At `cdec7473`,
176176
> `CurrencyValueSchema` is still exported and marked `@deprecated`
177-
> (`packages/spec/src/data/field.zod.ts:581`, its type at `:3062`). The
178-
> retirement is carried by #27182, which records its landing here.
177+
> (`packages/spec/src/data/field.zod.ts#CurrencyValueSchema`, its type
178+
> `#CurrencyValue`). The retirement is carried by #27182, which records its
179+
> landing here.
179180
> Second, multi-currency keeps this decision. ADR-0144 (ruling `6465431966`
180181
> on #27119) puts a record's currency in a sibling ISO 4217 code field that
181182
> the amount names through `currencyField`, never in the value, so a

‎docs/adr/0144-multi-currency-record-currency-dated-rates-write-time-home-projection.md‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
shape verdict [`6041482631`](https://github.com/objectstack-ai/objectstack/issues/8345#issuecomment-6041482631);
1919
[#27119](https://github.com/objectstack-ai/objectstack/issues/27119) (design record, workload rows, ruling); this
2020
record's card [#27183](https://github.com/objectstack-ai/objectstack/issues/27183). Every claim below about current
21-
behaviour cites a file and line on `origin/main` at `cdec7473`.
21+
behaviour cites a file or symbol as read on `origin/main` at `cdec7473`.
2222

2323
---
2424

@@ -51,7 +51,7 @@ Three kinds of text feed this record. Each section says which kind it carries.
5151
measurement round `6041378776` and the shape verdict `6041482631`. They supply the context, the shapes considered
5252
and the per-card plan. A detail that appears only there is not ruled. This record lists such details under
5353
[Open items](#open-items) or as a card's draft, never as a decision.
54-
3. **Readings.** Current behaviour, measured at `cdec7473` and cited by file and line.
54+
3. **Readings.** Current behaviour, measured at `cdec7473` and cited by file or symbol.
5555

5656
**Two numberings meet here.** #27119 is a decision batch, and two of its items are also called Q1 and Q2. #27119 Q1
5757
asks when multi-currency starts, and the answer was 乙-现在. #27119 Q2 asks for one rule for an unknown currency, and
@@ -66,25 +66,25 @@ aggregation. The ruling names them by topic ("Q0 A", "rates A", "home currency A
6666
### 1. What the platform has today (read at `cdec7473`)
6767

6868
- **A currency value is a bare number** (ADR-0104 D1). `currencyConfig` has two modes
69-
(`packages/spec/src/data/field.zod.ts:558`). In `fixed` mode the field has one currency, `defaultCurrency`. In
69+
(`packages/spec/src/data/field.zod.ts#CurrencyConfigSchema`). In `fixed` mode the field has one currency, `defaultCurrency`. In
7070
`dynamic` mode (the default) amounts display in the tenant default currency. The describe says "Neither mode is a
7171
per-record choice: the value is a bare number either way." No key, column or value carries a record's currency.
72-
- **A `fixed` field with no code becomes a yuan field.** `defaultCurrency` defaults to `'CNY'` (`field.zod.ts:559`).
72+
- **A `fixed` field with no code becomes a yuan field.** `defaultCurrency` defaults to `'CNY'` (same schema).
7373
#27157 (#27119 Q2 X) requires the code and drops the default. It is a member of R1 and a blocker of M0-1.
7474
- **The tenant currency is the `localization.currency` setting**
75-
(`packages/services/service-settings/src/manifests/localization.manifest.ts:105`). It has tenant scope, no platform
76-
default and `valueDomain: 'iso_4217_currency'` (`:124`). It may be unset. It is mutable and keeps no history: probe B
75+
(`packages/services/service-settings/src/manifests/localization.manifest.ts#localizationSettingsManifest`, key
76+
`currency`). It has tenant scope, no platform default and `valueDomain: 'iso_4217_currency'`. It may be unset. It is mutable and keeps no history: probe B
7777
of the measurement round saw a change relabel every stored `dynamic` amount.
78-
- **The ISO 4217 value domain exists** (`packages/spec/src/shared/value-domain.zod.ts:159`). It checks membership in
79-
`CURRENCY_FRACTION_DIGITS` (`packages/spec/src/data/currency-fraction-digits.ts:59`). Only that table's key set is
78+
- **The ISO 4217 value domain exists** (`packages/spec/src/shared/value-domain.zod.ts#isValueDomainMember`). It checks
79+
membership in `CURRENCY_FRACTION_DIGITS` (`packages/spec/src/data/currency-fraction-digits.ts#CURRENCY_FRACTION_DIGITS`). Only that table's key set is
8080
read. Its fraction-digit values have no reader.
8181
- **No conversion is implemented.**
8282
`git grep -n -i -E "exchange.?rate|fx_rate|currency_conversion|convertCurrency" -- packages/ ':!*.test.ts'` prints 0
8383
lines. Control: `git grep -c currencyConfig -- packages/spec/src/data/field.zod.ts` prints 13.
8484
- **The CEL standard library is pure.** Its header says: "Nothing registered here may be handed a resolver, a lazy
85-
getter or any other callback into the host" (`packages/formula/src/stdlib.ts:6`). That purity keeps
85+
getter or any other callback into the host" (`packages/formula/src/stdlib.ts`). That purity keeps
8686
`objectstack build` byte-stable, so a formula function cannot read a rate table.
87-
- **`CurrencyValueSchema` is still exported**, marked `@deprecated` (`field.zod.ts:581`, its type at `:3062`), although
87+
- **`CurrencyValueSchema` is still exported**, marked `@deprecated` (`packages/spec/src/data/field.zod.ts#CurrencyValueSchema`, its type `#CurrencyValue`), although
8888
ADR-0104 D1 says it "is deleted". #27182 retires it.
8989
- **Today's numbers are silently wrong** (from the measurement round's probes over a real ObjectQL engine; the scratch
9090
files were run and deleted and are not re-run for this record). The probes model a record currency the way authors
@@ -248,7 +248,7 @@ Version Packages, and the epic body says that happens only when a pair is comple
248248
These are outside this decision, and each would need a decision of its own. The first eight are the workload rows'
249249
"What is not in this list", each "a capability with no pull in tree". The last comes from the design record §13.
250250

251-
- A CEL `convertCurrency()`. The shape rules it out (D1), and it conflicts with `stdlib.ts:6`.
251+
- A CEL `convertCurrency()`. The shape rules it out (D1), and it conflicts with the purity rule in the header of `packages/formula/src/stdlib.ts`.
252252
- Read-time conversion.
253253
- A built-in provider feed (ECB or similar). An app flow writes rows instead (D3).
254254
- N×N pair rates. Every rate is against the home currency.
@@ -298,7 +298,7 @@ Where a source leans one way, the lean is quoted here, not adopted. This record
298298
says money is computed in minor-unit integers or decimals, not floating point (「浮点算钱用最小单位整数或 decimal」).
299299
Neither point is in the ruling.
300300
4. **A home-amount declaration or a converting write while no home currency is set** (#27192, #27198).
301-
`localization.currency` may be unset (`localization.manifest.ts:105`: `required: false`, no platform default). The
301+
`localization.currency` may be unset (its manifest entry says `required: false`, and there is no platform default). The
302302
ruling locks the setting once used. It does not say what happens while the setting is unset. The sources rule out a
303303
silent default (design record §9: no CNY default).
304304
5. **The unit of parameter 4** (#27185). "12 significant decimals" can mean 12 significant digits or 12 digits after
@@ -320,16 +320,16 @@ Where a source leans one way, the lean is quoted here, not adopted. This record
320320

321321
## Verification notes
322322

323-
Each reading below was taken at `cdec7473`. To re-check one, run its command on a newer `origin/main` and compare. A
324-
changed line number means the file moved, not that the fact changed. Re-read the line before citing it.
323+
Each reading below was taken at `cdec7473`. To re-check one, run its command on a newer `origin/main`. The comment
324+
says what the command printed at `cdec7473`.
325325

326326
```bash
327-
git grep -n "Neither mode is a per-record choice" -- packages/spec/src/data/field.zod.ts # :558
328-
git grep -n "default('CNY')" -- packages/spec/src/data/field.zod.ts # :559, until #27157
329-
git grep -n "export const CurrencyValueSchema" -- packages/spec/src/data/field.zod.ts # :581, until #27182
330-
git grep -n "may be handed a res" -- packages/formula/src/stdlib.ts # :6
327+
git grep -n "Neither mode is a per-record choice" -- packages/spec/src/data/field.zod.ts # 1 line
328+
git grep -n "default('CNY')" -- packages/spec/src/data/field.zod.ts # 1 line, until #27157
329+
git grep -n "export const CurrencyValueSchema" -- packages/spec/src/data/field.zod.ts # 1 line, until #27182
330+
git grep -n "may be handed a res" -- packages/formula/src/stdlib.ts # 1 line
331331
git grep -n -i -E "exchange.?rate|fx_rate|currency_conversion|convertCurrency" -- packages/ ':!*.test.ts' # 0 lines
332-
git grep -n "valueDomain: 'iso_4217_currency'" -- packages/services/service-settings/src/manifests/localization.manifest.ts # :124
332+
git grep -n "valueDomain: 'iso_4217_currency'" -- packages/services/service-settings/src/manifests/localization.manifest.ts # 1 line
333333
```
334334

335335
## References

0 commit comments

Comments
 (0)