Skip to content

Exercise protected business commits and cancellation with a SQL example - #1148

Merged
rmcdaniel merged 2 commits into
mainfrom
general/1069-business-commit-20261114
Nov 14, 2026
Merged

rmcdaniel merged 2 commits into
mainfrom
general/1069-business-commit-20261114

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

The business transition contract delegates commit safety to application code and previously tested it with controlled activity responses. This adds an application-owned SQL reference that atomically changes business state, records the immutable decision and records publication intent. Cancellation and authority revocation share the subject-row fence. Exact retries recover the original decision after a lost acknowledgement; changed content and stale revisions refuse.

The trusted host authorizes the complete execution/transition/assessment before protected access. The row lock checks the authenticated principal and current authority version. These are example application tables, with no DW migration or core runtime change. Standard PHPStan now discovers and analyzes the example directory without ignores or reduced checks.

Validation at exact f634df6/tree2edc8d79: 11 SQLite tests / 36 assertions; six separate-process MySQL races / 50 assertions; and all six hosted PostgreSQL races / 50 assertions, with no skips. The races observe the competing row-lock query in both cancellation/completion and revocation/completion orderings, plus duplicate and competing completion. ECS and full PHPStan pass. All 25 ordinary current-head checks succeed, with six intended unselected lanes skipped. Final independent source/integration review is PASS. Accepted main through PR1147 is incorporated; the nine authored file blobs remain identical to their reviewed source.

This is the SQL persistence reference part of #1069. The Workflow repository owner drives the unfinished machine/profile/rule/slot contracts, provider and publication delivery, retained-child application integration and complete runnable two-integration workflow. The remaining #1069 acceptance criteria are unfinished, and no release is selected.

Delivered at normal merge f9bcaf060952f15cdc0b4c437dfe002e4c713ba6, exactly equal to the reviewed tree. All five actual-main workflows, 28 build jobs and 34 check contexts are terminal success or intended skips. Topic cleanup and the final verification receipt are complete. Workflow owns the remaining #1069 application work.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security/source review PASS for exact c355c3d55d914a245bb38c6302c2d48637ab220e / tree a8f0b089a1f5686360f1c8bc352da7b511380564, scoped to the seven-file SQL example/API/storage delta on reviewed parent 12ad6f0.

I found no source-level authorization, tenant-boundary, idempotency, or atomicity defect in this slice:

  • the trusted host authorizes the full execution/principal/operation/context before protected SQL, caller-owned transactions refuse, and the returned live authority version is rechecked with the principal and exact scope/subject under the subject-row lock;
  • cancellation, authority revocation, completion, duplicate completion, and competing revisions serialize on that one application row;
  • decision identity plus the canonical request fingerprint prevents cross-subject/content substitution, while an exact retry returns the recorded result after a lost acknowledgement;
  • business state, immutable decision, and publication intent share one transaction, so a publication-intent conflict rolls the state/decision mutation back;
  • the example owns only its application tables and performs no provider publication, DW migration, or core runtime change.

git diff --check is clean. I did not rerun PHP locally because this review environment has no PHP/vendor installation; the reported SQLite/MySQL tests, outstanding hosted PostgreSQL proof, current CI, and the unfinished publication/provider/retained-child/full-#1069 work remain separate qualification gates. This verdict does not select a merge, runtime, provider, or release effect.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security narrow source rebind PASS for exact a1a4227b5a4cd326c3ad424c583e824dd27481fd (tree 713d469a648eab45deefd2689b59d9cd7f520784).

I independently compared the seven implementation, schema, test, and documentation blobs from reviewed c355c3d55d914a245bb38c6302c2d48637ab220e; all seven object IDs are byte-identical at this head. Against accepted parent b6a235f2e0030740f6ad0d7eff2088e0f2c7e9ee, the only additional authored scope is:

  • composer.json: the existing composer stan command now analyzes examples/business-state-machines alongside src and tests;
  • phpstan.neon: that same directory is added to scanDirectories so its application-owned classes are discoverable.

No PHPStan level, ignore, exclusion, baseline, runtime, persistence, authorization, schema, or test behavior changes in this successor. git diff --check passes. The accepted-main composition introduces no conflict or manual rewrite in the seven reviewed blobs.

This rebind covers the two-file analysis-discovery correction and exact-head source composition only. Current hosted quality/backend checks, including the outstanding PostgreSQL race proof, remain integration gates; it does not qualify a release or complete #1069.

@rmcdaniel
rmcdaniel changed the base branch from general/1069-retained-child-scope-20261114 to main November 14, 2026 15:10
@rmcdaniel
rmcdaniel force-pushed the general/1069-business-commit-20261114 branch from b5d3ba6 to f634df6 Compare November 14, 2026 15:15
@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security exact-head rebind: PASS for f634df6ea56535646f78e8cd5a050dcb102b1611 / tree 2edc8d79f3b8a411479f82930719a85cd2c13072.

All nine PR-owned paths are byte-identical to the previously reviewed a1a4227b5a4cd326c3ad424c583e824dd27481fd head, including the application SQL store, schema, fixture, unit/race tests, documentation, and the two PHPStan configuration changes. The branch is now directly based on accepted main 59fc408d9c129b0244608fa1685b722e2a2d10f9; the only full-tree difference from a1a4227b is the already accepted PR1147 test composition. There is no new authorization, transaction, persistence, publication-intent, retry, schema, or runtime behavior and no manual conflict rewrite in the reviewed blobs.

Current-head full CI remains required. This narrow rebind does not broaden the earlier source verdict into provider, release, or complete #1069 acceptance.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security final exact-head integration disposition: PASS for f634df6ea56535646f78e8cd5a050dcb102b1611 / tree 2edc8d79f3b8a411479f82930719a85cd2c13072.

The nine PR-owned files remain byte-identical to the reviewed a1a4227b source; this head only composes accepted main through PR #1147. The current-head check set is terminal with 25 SUCCESS / 6 intended SKIPPED / 0 failed / 0 pending, including central policy preflight, CodeQL, public-boundary scans, quality/static analysis, regression corpus, unit/contract/tracing/MySQL selection, and all six PostgreSQL shards.

This closes the bounded source/security and current-head integration review for normal repository handling. It does not claim a runtime/provider effect, release selection, or completion of the wider #1069 work.

@rmcdaniel
rmcdaniel marked this pull request as ready for review November 14, 2026 15:49
@rmcdaniel
rmcdaniel merged commit f9bcaf0 into main Nov 14, 2026
31 checks passed
@rmcdaniel
rmcdaniel deleted the general/1069-business-commit-20261114 branch November 14, 2026 16:20
@rmcdaniel

Copy link
Copy Markdown
Member Author

SQL business-commit example delivery is complete at normal merge f9bcaf060952f15cdc0b4c437dfe002e4c713ba6, tree 2edc8d79f3b8a411479f82930719a85cd2c13072, exactly equal to the reviewed/tested f634df6e. The merge parents are accepted 59fc408d plus that head.

All five actual-main workflows are terminal SUCCESS, including main build 43612290254. Unit coverage, backend jobs, combined coverage and final analysis passed. The actual hosted PostgreSQL qualification also executed all six races with 50 assertions and no skips at the reviewed head. Independent exact-head integration review remains bound to the unchanged example. The owned topic was deleted with an exact-head guard and independently verified absent.

This delivers the application-owned SQL commit/cancellation example and its qualification. Workflow owns the remaining #1069 runnable application and StateMachine criteria. Provider delivery, retained-child application integration, the unresolved root-initialization boundary and full feature completion are not established by this example. No release is selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant