Skip to content

Commit 4d7175d

Browse files
committed
Merge origin/main into claude/issue-38941-eval-false-reds
Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ
2 parents 0a66dc9 + edff475 commit 4d7175d

168 files changed

Lines changed: 7977 additions & 690 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
'@objectstack/formula': minor
3+
'@objectstack/spec': minor
4+
---
5+
6+
fix(formula)!: a flow condition's date arithmetic that mixes a bare date field with `record.FIELD` / `previous.FIELD`, and a field read by index (`record['FIELD']`), now take the verdicts their consistent spellings already took
7+
8+
Clause-②: no (narrowing)
9+
Metadata-protocol: narrowed
10+
Skills-docs: none — `skills/objectstack-formula/SKILL.md` already states "The build refuses date arithmetic (`end - start`, `date + n`)" and that a `date` / `datetime` field is refused in a timestamp-only call, naming no spelling those rules are limited to, so they now hold for the mixed and index spellings as written; no skill teaches the index spelling
11+
12+
<!-- adr-0087: registered flow-condition-mixed-or-index-spelling-date-text-refused -->
13+
14+
**BREAKING** accept-set narrowing. In a flow condition (a start, edge or `decision` branch condition) the run binds the record's fields under their bare names and also as `record`, with the row before the write as `previous`. A `date` or `datetime` field reaches the run as its text, so subtracting one from another faults on every run and fails the flow. Two spellings of that mistake passed `os validate` and the publish door with no finding:
15+
16+
- **Mixed operands.** `due_date - record.borrow_date > duration('24h')`, `previous.due_date - due_date > duration('24h')`. The all-bare (`due_date - borrow_date …`) and all-root (`record.due_date - record.borrow_date …`) spellings were refused already. The check typed the bare names and the root reads in two separate passes, each leaving the other spelling untyped; they are now typed against the object's field table in one pass.
17+
- **Index reads.** `timestamp(record['borrow_date']) < now()`, `record['due_date'] - record['borrow_date'] > duration('24h')`, `isoDate(record['picked_up_at']) == '2026-11-16'`, `record['due_date'] + 1 > 5`. The record-root date-text pass only looked at the member spelling; it now has a gate of its own that admits an index read of `record` or `previous`, so the index read takes the date-text verdicts the member read takes, named by its member spelling, and those only (`record['due_date'] + 1 > 5` takes `date-text-arithmetic`, where its member spelling takes `date-arithmetic`; both prescribe `daysBetween` / `addDays`). The text and boolean mismatch keeps its member-only gate: through an index read, `record['title'] > 5` and an ordering against a text field (`record['due_date'] > record['title']`) are judged exactly as before, and no refusal an expression had before is stood down to a warning.
18+
19+
- **The verdict.** The code, outcome arm and words of the consistent spelling: `date-text-arithmetic-run-fails` on a record-triggered flow or a sweep of the typed object, `-run-may-fail` elsewhere. A mixed verdict that rests on a bare name takes the bare name's `-run-may-fail` arm where a node can rebind it.
20+
- **Where.** `os validate` / `os build` (`validateStackExpressions`) report an `error`, and the flow publish door refuses the publish with `INVALID_METADATA` (422). `registerFlow` logs it as an advisory and still registers the flow, so a stored flow keeps its run-time behaviour until it is next published.
21+
- **Not refused.** An operand the field table does not type keeps passing: a flow variable or node output holding an instant (`cutoff - record.due_date > duration('24h')`, `get_policy.effective_at - record.due_date > duration('24h')`), a bare name a flow variable shadows, a concatenation of the date text (`prefix + record.due_date`); through an index read, the text or boolean mismatch, an ordering against a text field and equality. The run-time evaluator is unchanged.
22+
23+
## FROM → TO
24+
25+
| FROM | TO |
26+
|:---|:---|
27+
| `due_date - record.borrow_date > duration('24h')` | `daysBetween(record.borrow_date, due_date) > 1` |
28+
| `timestamp(record['borrow_date']) < now()` | `date(record['borrow_date']) < now()` |
29+
| `record['due_date'] - record['borrow_date'] > duration('24h')` | `daysBetween(record['borrow_date'], record['due_date']) > 1` |
30+
31+
One-line fix: in a flow condition, never subtract one date field from another or hand one to a timestamp-only call, whichever way it is spelled; use `daysBetween(a, b)` for a span, `addDays(d, n)` to shift a date and `date(…)` to parse it.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/plugin-grid': patch
3+
'@object-ui/plugin-form': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
fix(console): a closed row in a grid reads as closed, not as in approval, and a save that closes a master writes its lines first
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
The grid and the line grid now ask the data layer's one lock read (`POST /api/v1/data/{object}/locks`, on the first cell or row selection) for the edit and delete affordances of a row, and word the reason from its `lockReason`. They no longer ask the approvals lock read for this.
13+
14+
- A closed row (`lockReason: 'closed_state'`, its own state or its master's) opens no cell editor, and the cell says "This record is closed, so it can't be changed." Its row menu offers neither Edit nor Delete, for either `lockSource`. A row that is closed and also held by an approval reads as closed.
15+
- A row held by an approval behaves as before: its own approval keeps Delete, and a line of a held master does not.
16+
- The answer is read above the caller's field permissions, so a reader who may not see the state field still gets the closed wording.
17+
- A master-detail edit save that sets a closing state on the header (a value its object lists in `closedStates`) writes every line first and the header last, in one batch, so the save is not refused against the record it is closing. A save that does not close keeps the header first.
18+
- New string `grid.readOnlyReason.closedLocked` in every console locale.
19+
20+
The grid's lock read is gated on the `data` route in discovery, not on the approvals service, and makes the same number of requests as before. The record page is unchanged here.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/types': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
fix(console): a closed record's page reads as closed, not as in approval, from the page's one request
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
The record page now reads the data layer's lock for its Edit and Delete, and words the reason from its `lockReason`. It asks for that lock in the request it already sends when it opens (`POST /api/v1/data/{object}/{id}/page` with `dataLock: true`), so opening a record page is still one request. It no longer asks the approvals lock read for these affordances; the approvals panel and the header's approval tag keep reading it.
13+
14+
- A closed record (`lockReason: 'closed_state'`, its own state or its master's) shows Edit greyed with "This record is closed, so it can't be changed.", a "Closed" chip, and no Delete, for either `lockSource`. Its master-detail lines offer no New, Edit or Delete. A record that is closed and also held by an approval reads as closed.
15+
- A record held by an approval behaves as before: its own approval keeps Delete, and a line of a held master does not.
16+
- The answer is read above the caller's field permissions, so a reader who may not see the state field still gets the closed wording, and the page shows neither the field nor its value.
17+
- When nothing on screen is a record page, the edit dialog opened over a list reads the record's lock through `GET /api/v1/data/{object}/{id}/lock` next to its approvals reads. The record page does the same when it re-reads after the record changes. Over its record page, the dialog reuses the page's answer and sends nothing.
18+
- `RecordPagePayload` (`@object-ui/types`) declares the payload's `dataLock` part.
19+
- New strings `detail.lockedClosed` and `detail.lockedClosedTooltip` in every console locale.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
fix(metadata-protocol): the bare doc read of the environment's own entry carries the environment's envelope, never a package holder's
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
A doc read that names no package (`GET /api/v1/meta/doc/NAME`, and the in-process `getMetaItem` with no `packageId`) answers the environment's own doc entry when one or more enabled packages ship the same name. It served that entry's content under the first registered holder's envelope: `item._packageId` and `item._packageVersion` that holder's, `_provenance: 'package'`, and the read envelope's `packageId`, `packageVersion` and `provenance` likewise. A client trusting the envelope read the environment's item as that package's, and with two holders the package it named followed registration order.
12+
13+
FROM the entry under the first registered holder's envelope, TO the entry under its own: no `_packageId` or `_packageVersion`, its own `_provenance` (`org` for a stored row the environment saved), and no `packageId` on the envelope. The lock is unchanged: it is still the write doors' answer at that address, and a save naming no package is still refused while a holder ships the name, so the envelope still reports `lock: full`. `?package=PACKAGE` still reads that package's doc under that package's envelope. `/layers` and `/published` carried no package envelope and are unchanged.
14+
15+
The fix for a caller that read the holder's id from the bare read: name the package (`?package=PACKAGE`, or `packageId` in process). The `os migrate meta --from 18` entry `doc-bare-read-environment-entry-first` no longer lists this as a known deviation.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/service-automation': patch
3+
---
4+
5+
fix(automation): reading one run answers the run's final row over this process's stale "paused" entry
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Reading one automation run (`getRun`, which backs the run-detail route and the approvals plugin's judgement of a run) answered from this process's in-memory run log first, and only looked at the run history store when that log had nothing. On a deployment with more than one process, a run that paused in this process and was then resumed and finished by another process kept reading `paused` here, although the store held its `completed` (or `failed`, `cancelled`) row. The approvals plugin reads a run that is `paused` with no pause left as stopped, so it could abandon an approval whose run had in fact finished.
11+
12+
Now, when this process's entry for the run is not terminal, the read asks the store for the run's terminal row, and that row answers, on the default read and on the strict read (`getRun(runId, { strict: true })`) alike. Two cases keep this process's entry as the answer:
13+
14+
- **The store holds no terminal row for the run.** The `paused` entry answers as before; the run's suspension row is not read for it.
15+
- **The store also holds a live pause for the run.** That is a run put back after it ended: an operator's `restoreConsumedSuspension` re-parks a failed run and records it `paused`, leaving its `failed` row in place. The `paused` entry is the later word then, and the run still reads `paused`, as it did before this change.
16+
17+
A run whose entry in this process is already terminal is answered with no store read. The added cost is one read of the run's terminal row for a run whose entry here is `paused`, plus one read of its live pause only when a terminal row is found; a run with no entry in this process already paid the first read.
18+
19+
Where one of these added reads fails, the default read answers this process's entry and logs, at `warn`, that it did; the strict read throws the store's failure to its caller, as it already does for the store reads it made before. The strict read's contract (a store failure is the caller's answer, never "no such run") is otherwise unchanged.
20+
21+
No action is needed.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/plugin-approvals': patch
3+
'@objectstack/service-automation': patch
4+
'@objectstack/spec': patch
5+
---
6+
7+
fix(plugin-approvals): an approval's run is read by the steps it logged by its end, not a fan-out branch that went on after it
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
When a flow's node fans out to branches that run together and one branch fails, the automation engine does not stop the others: they go on appending steps to the run's log after the run has ended. The approvals plugin read the last top-level step of a terminal run as where it stopped, and any later step as the run going on past a step, so a step another branch completed after the run's end moved both readings: the reconciler placed a failed run at the other branch's node (and told a failure the flow never routed as one it went on from), and took a child run with no history row as passed. Both readings now use only the steps the run completed by its `completedAt`; a run that names no `completedAt`, and a step completed in the same millisecond, read as before.
13+
14+
Also: the terminal history row serializes a log under its size cap once, not twice (`@objectstack/service-automation`); the source comment over the step log's `childRunIds` no longer says a reader reaches every run of its tree from the log alone, since the list is bounded and can be shed (`@objectstack/spec`, comment only, no schema change).
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
'@objectstack/service-segmenter': patch
4+
'@objectstack/spec': patch
5+
'@objectstack/cli': patch
6+
---
7+
8+
feat(platform-objects, service-segmenter): the 检索词条 object `sys_search_term`, the administrator's search words
9+
10+
Clause-②: yes
11+
Metadata-protocol: none
12+
13+
`@objectstack/platform-objects` declares `sys_search_term` (检索词条, Search Term): one record per word an administrator adds to search, one set for the whole deployment (no organization column). Fields: `term`, `kind` (`word` custom word or `stop_word`), `purpose` (`knowledge`, `record_search` or `both`; default `knowledge`, the only one implemented), `knowledge_source` (one knowledge source; empty for every source), `enabled` (default on) and `note`. `term`, `kind`, `purpose` and `enabled` are the segmenter contract's `SegmenterEntry` one to one. The object is `system-data` with CSV import opted in, so New, Edit, Delete, Import, Export and record history are the platform's own; every operation, writes included, requires `manage_platform_settings`. A record that disables a platform word (年假, 脱密, 应急采购, …) is refused: those words live in the segmenter's read-only dictionary, so make one a stop word instead. A platform stop word can be disabled. The platform words move here as `PLATFORM_SEARCH_WORDS`, and the segmenter's `PLATFORM_WORDS` reads them, so the object and the service hold one list.
14+
15+
`@objectstack/service-segmenter`: `SegmenterServicePlugin` registers `sys_search_term` on the manifest service (`SEARCH_TERM_BUNDLE_ID`), with no Setup entry. Nothing reads the records yet: the knowledge service passes them to the segmenter in a later release, and the object gets its Setup entry then.
16+
17+
`@objectstack/spec` lists `sys_search_term` among the platform-provided object names. `@objectstack/cli` gives it a row in the organization-ownership inventory (no organization column to drop).
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
'@objectstack/rest': patch
4+
'@objectstack/runtime': patch
5+
---
6+
7+
fix(metadata-protocol): a disabled package counts for nothing at the environment address, the delete naming no package and the read beside a package-less row
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
A disabled package holds no name and is never named (ADR-0150 D3). Three doors still counted one.
13+
14+
- **`GET /api/v1/meta/TYPE/_env/NAME`** (the plain read, `?layers=true`, `?state=draft`, `?preview=draft`, and the `_env/NAME` spelling of an import's `mappingName`), for a name the registry knows only through a disabled package while an enabled package holds it through a stored row or draft the registry has not loaded: the answer was `409 RESOURCE_CONFLICT` naming the disabled package. It is now `409 RESOURCE_CONFLICT` naming the enabled package whose row or draft the read that names no package serves (`details.candidates`), and never that row. Where that read answers 404, `_env` still answers 404.
15+
- **`DELETE` naming no package, and the draft discard naming no package**, of an item whose stored rows are bound to a disabled package and to the one enabled package that ships the name: the answer was `409 RESOURCE_CONFLICT` naming both. Each now removes the enabled package's row or draft, as the same request with `?package=` naming it does, and leaves the disabled package's rows as they are. With two or more enabled holders the refusal still names exactly them.
16+
- **The receipt of `DELETE` and of the draft discard**, bare or naming the enabled package, beside a disabled package's rows: it said the item "still carries another overlay: its row bound to package 'D' remains", naming the disabled package, and for a name only a disabled package ships in code it said "reset to artifact default". A disabled package's row is no remaining overlay and its code is no artifact default: the receipt now reads as it does without the disabled package ("reset to artifact default" where the enabled package ships the name, "it no longer exists" where no enabled package does). Repeating the bare delete or discard once the enabled package's row or draft is gone answered by removing the DISABLED package's row or draft (a customization hidden with it); it now answers the no-op receipt at the enabled package's address and leaves the disabled package's rows stored. A `dropStorage` delete still counts every stored row.
17+
- **The read that names no package** (`GET /api/v1/meta/TYPE/NAME`, `/layers`, `/published`), of a name a disabled package ships in code only, beside one enabled package's stored row and a package-less row: the answer was 404. It now serves the enabled package's row, as it does when the disabled package does not ship the name.
18+
19+
Not changed here: the draft save naming no package of the second case still answers `409` naming both packages. To write the enabled package's draft now, name it: `?package=PACKAGE`.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/skills': patch
3+
'@objectstack/mcp': patch
4+
---
5+
6+
docs(skills): the `objectstack-ask` skill says a word that names the field a filtered measure aggregates is answered from that field, not asked about
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The `objectstack-ask` skill, and the page at `GET /mcp/skill` that is generated from it, now state the rule `list_datasets`' description and the MCP `initialize` selection rule already carry (ADR-0149 D3, the amendment note of 2026-12-01). Step 1: a measure that carries a filter and aggregates a field the word names (the word equals or is inside the field's label or name; the name only where the host reads no field labels) is not offered for that word among `candidates`. A measure with no filter, or over a relationship path, is offered as before, and so is every measure when the word names different fields through different candidates. Step 2 has one new row: for such a word `nextStep.note` names the field, the client does not ask about that measure, answers from the field under the labelled fallback (step 4) and mentions the measure as a narrower declared metric; another measure candidate left for the word is asked about first, and the field then answers only if that question settles nothing.
12+
13+
The instruction to list each candidate's label, its dataset's label and its description was written twice, in the several-measures row and in the paragraph under the table. It now has one home, the row, which also says "as written, one bullet each". `packages/mcp/src/ask-skill.generated.ts` is regenerated from the skill; no code path changes.

0 commit comments

Comments
 (0)