Skip to content

Commit 0a78bfc

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/issue-38710-analyzer-jieba
2 parents 9556620 + 7625001 commit 0a78bfc

1,100 files changed

Lines changed: 56136 additions & 3982 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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/example-crm': patch
3+
---
4+
5+
examples(crm): the public Web-to-Lead form is a `form` item
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The Web-to-Lead form moves out of `crm_lead`'s view container (its `formViews.web_to_lead` entry) into `src/forms/lead.form.ts`, a `defineForm` item named `crm_lead.web_to_lead` and listed in the stack's `forms:`. Its name, sections and submit answer stay as they were, and `GET /api/v1/meta/form` names the same form, now authored rather than projected. The lead view container now declares lists only.
11+
12+
**The public address moves from `/forms/contact-us` to `/forms/web-to-lead`** (`GET /api/v1/forms/web-to-lead`, `POST /api/v1/forms/web-to-lead/submit`). The showcase example's contact form holds `/forms/contact-us`, and two `form` items may not share one public address, so installing the CRM example into an environment that runs the showcase was refused (`409 FORM_ADDRESS_TAKEN`). An embed or link that pointed at the CRM example's `/forms/contact-us` must point at `/forms/web-to-lead`. The resolve door answers the same body at the new address, less the old shape's `form.data` binding.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/example-showcase': patch
3+
---
4+
5+
examples(showcase): every named form is a `form` item, and each layout form has an action
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The task's default form and its four layout forms (`showcase_task.form`, `.tabbed`, `.wizard`, `.split`, `.quick`) and the public contact form (`showcase_inquiry.contact`, `/forms/contact-us`) move out of their view containers into `src/ui/forms/task.form.ts` and `src/ui/forms/inquiry.form.ts`, `defineForm` items listed in the stack's `forms:` beside the feedback form. Names, sections, links and translations stay as they were; the contact form's thank-you translation moves from `objects.showcase_inquiry._views.contact.submitBehavior` to `forms['showcase_inquiry.contact'].submitBehavior`. The task and inquiry view containers now declare lists only.
11+
12+
Each layout form gets one form action as its door: **New Task (Tabbed)** and **New Task (Wizard)** on the task list toolbar, and **Edit in Tabs** (`split`) and **Quick Edit** on a task row. Before, those four forms were reachable only by typing their `/forms/NAME` address.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/plugin-approvals': patch
3+
---
4+
5+
fix(approvals): an abandoned approval never writes a closed value on its status mirror (ADR-0162 D5, Execution item 7)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A request is abandoned by its submitter's recall (while it is pending, or in the revise window after a send-back), by the override arm of a recall (an administrator, or a system context), and by the sweep that releases a record held by a dead run. Each puts a value back on the field the approval mirrors its status onto. Where the object's `closedStates` lists any value for that field (ADR-0162 D1), the mirror now chooses that value so that it never closes the document again:
11+
12+
- **`recalled`** is written where the field declares it and the object does not close on it, as before. A declared `recalled` the object closes on is withheld, and a `warn` line says so: listing `recalled` among the closed values closes nothing through the mirror.
13+
- **Otherwise the order**: the value held at submit, the field's declared default, empty. A closed value is passed over at each step, and on a required field an empty value at submit is passed over for the default. A pass is logged at `info`.
14+
- **A closed value the approval did not write is left alone.** Where the field holds a closed value, the mirror asks the request table once, by the request's root run and record, whether a request of the same approval on the same record had that value as its status. Where none did, it writes nothing and logs it at `info`. A request of the approval on another record (another item of a `map`) does not count. Where it cannot tell (the request records no root run, or a request on the record that records none was opened since the approval's run started), it goes down the order.
15+
16+
Every other write of the mirror is unchanged, and so is every write on an object that closes on no value of the mirror field.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/lint': patch
3+
---
4+
5+
feat(lint): an approval that cannot show itself in progress on a field its object closes on is refused where it is authored (ADR-0162 D5)
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
Widened: `@objectstack/lint` exports `validateApprovalClosedStates`, `approvalRootObjectsOf`, `APPROVAL_CLOSED_STATE_GAP` and the type `ApprovalClosedStateFinding`; the rule's sentences are registered in all 11 platform locales.
11+
12+
A new member of the reference-integrity suite, `validateApprovalClosedStates` (finding `approval-closed-state-gap`, at error), judges each flow of a stack as the root of an approval, on each object it can start on a record of, through the one judge the approvals plugin's first request asks (`judgeApprovalOpeningSync`, `@objectstack/metadata-core`). `os validate`, `os build` and `os lint` refuse the gap on a project's stack, and the runtime publish door (Studio, REST `/meta`, MCP) refuses it with `INVALID_METADATA` (422) on a `flow` or an `object` write: an active save, a draft's promotion, a restore and a package publish (a draft save is not refused). An `object` write judges the written package's live flows and is charged only with a gap it adds. In a package publish each draft is judged against the batch's objects, and a flow the batch redrafts is judged as its draft, so a package that declares `closedStates` and repairs its flow in the same publish passes. The rule refuses only what it has in view: a call to a flow the stack does not hold, a node type the spec does not ship and a host with no `job` service are not refused here, and are judged at the approval's first request, which stays the rule. An object that declares no `closedStates` is judged nowhere.
13+
14+
Why the protocol line reads none: the rule reads only `closedStates`, which this release adds. No object a released version accepts declares it, so nothing that could be published before is refused now.

‎.changeset/37766-opening-check.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/plugin-approvals': patch
3+
---
4+
5+
feat(approvals): an approval that cannot show itself in progress on a field its object closes on does not open (ADR-0162 Execution item 7, the check)
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
Widened: `sys_approval_request` gains the engine-written, read-only column `between_steps_json`; `ApprovalService` gains `noteSweepClockScheduled()`, and the input of `ApprovalService.openNodeRequest` gains the optional member `locale` (the run's locale, for the refusal's wording); the plugin's message catalog gains twelve `approvalOpening*` sentences in all 11 locale packs.
11+
12+
At an approval's first request the plugin now reads the approval whole: the flow its root run was started on and every flow a `subflow` or a `map` in it names, to any depth. Where a step can act on an object that declares `closedStates`:
13+
14+
- **The between-two-steps set is stamped** on the request, and every later request of the same approval carries the same set. It lists the nodes after which a step of the approval can still follow, so that a run that stops there can later be told from one that stopped after the last step.
15+
- **The approval does not open** where a step mirrors onto a field the object closes on at `pending`, `returned`, `approved` or `rejected`, and one of these is missing: the field declares `pending` and the object closes on neither `pending` nor `returned`; a `state_machine` rule on the field that declares the moves out of a closed `approved` or `rejected` includes `pending` among them; the field has no `readonlyWhen` and no request-status option has a `visibleWhen`; every step that can act on the object mirrors onto the same field; no node that can pause the run (a `wait`, a `screen`, a node type with no descriptor) stands between two steps, and no `map` runs an approval step for items it does not show are not records. An approval one of whose flows cannot be read does not open either, and neither does one on a host that runs no `job` service.
16+
17+
A refused approval fails its run at the step with `VALIDATION_FAILED` and one sentence per gap naming the flow, the step, the object, the field and what is missing, in the run's locale. No request row is written.
18+
19+
Not judged, and unchanged: an application in which no object declares `closedStates`; an approval whose objects declare none, once it has been read whole (in an application where some object declares the key, an approval one of whose flows cannot be read is refused, whatever objects the parts that were read act on, since its objects cannot be known); a request whose run hands no root run; a later request of an approval already open (also one opened before the object declared the key); a request that cannot be placed because an earlier request on the record since its root run started records no root run. A writing node between two steps of a flow that runs as the user is not refused.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/metadata-core': patch
3+
---
4+
5+
feat(metadata-core): the judge of an approval's opening conditions on a closing field lives here, so every door asks one copy (ADR-0162 D5)
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
Widened: `@objectstack/metadata-core` exports the judge the approvals plugin's first-request check used to hold, `judgeApprovalOpening` (it awaits each flow it reads), with `judgeApprovalOpeningSync` (over a stack in hand: a flow read that answers a promise counts as a flow it cannot read), the walk both drive, `approvalFlowWalk`, and the helper and types they read (`closedValuesOf`, `OpeningCheckSource`, `OpeningFlow`, `OpeningFlowBody`, `OpeningGap`, `OpeningJudgement` and the rest). `OpeningCheckSource.calleeFlow` may answer a flow or a promise of one. The verdict and its gaps are unchanged; nothing an author writes changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/plugin-approvals': patch
3+
---
4+
5+
refactor(approvals): the first-request check asks the opening judge in `@objectstack/metadata-core` (ADR-0162 D5)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The check an approval's first request makes on a field its object closes on now calls `judgeApprovalOpening` from `@objectstack/metadata-core`, the same judge the authoring rule `validateApprovalClosedStates` asks. `approval-opening-check.ts` re-exports it and its types under the names it exported before. Which approvals open, the refusal and its sentences are unchanged.

‎.changeset/37766-opening-lead.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/plugin-approvals': patch
3+
---
4+
5+
fix(approvals): the opening refusal no longer says the object closes on its approval field when its only gaps are the host's or an unreadable flow
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
Widened: the plugin's message catalog gains the sentence `approvalOpeningRefusedClosedStatesLead` in all 11 locale packs.
11+
12+
An approval's first request is refused when an object it can act on declares `closedStates` and the host runs no job service, or when a flow it runs cannot be read. Those gaps are raised whatever field the object closes on. The refusal's lead used to say "the object closes on its approval field" in every case, which is false for an object that closes on another field. Where every gap is one of those two, the lead now says only what is true: the approval can act on an object that declares `closedStates`. The sentences per gap are unchanged.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
feat(spec): a run's writes name the root run of its tree (`ExecutionContext.flowRootRunId`, `HookContext.provenance.flowRootRunId`, ADR-0162 D5)
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
Widened: `ExecutionContextSchema` and the `provenance` of `HookContextSchema` gain the optional string `flowRootRunId`, beside `flowRunId`: the run id of the root of the run tree the writing run belongs to (the run itself for a root run). The automation engine stamps it on every write a run makes; it is never read from a request. Nothing an author writes changes.

‎.changeset/37767-hold-root-run.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/core': patch
3+
'@objectstack/objectql': patch
4+
'@objectstack/service-automation': patch
5+
'@objectstack/runtime': patch
6+
---
7+
8+
feat(automation): every write of a run carries the root run of its tree (`flowRootRunId`, ADR-0162 D5)
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
13+
Widened: a data write a run makes (`resolveRunDataContext`, the run identity of `@objectstack/service-automation`) carries `flowRootRunId`, the run id of the root of its run tree, beside `flowRunId`; the engine carries it onto the write's `HookContext.provenance` (`@objectstack/objectql`), the platform system api strips it with the other run marks, a sandboxed body and script see it among the declared provenance members (`@objectstack/runtime`), and it is one of the fields an entry point may not set on an `ExecutionContext` (`assembleExecutionContext`, `@objectstack/core`). The approvals plugin reads it to let every run of an approval through the hold. Absent on a write that is not a run's.

0 commit comments

Comments
 (0)