Skip to content

Track activity with owner-side upsert folds - #5187

Merged
meshweaver-cloud[bot] merged 3 commits into
mainfrom
codex/core-hard-issues-0922
Sep 22, 2026
Merged

meshweaver-cloud[bot] merged 3 commits into
mainfrom
codex/core-hard-issues-0922

Conversation

@rbuergi

@rbuergi rbuergi commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Activity tracking now uses the existing owner-side create-or-update operation with serialized content folds, so a stale search row cannot choose an unsafe update or supply a counter value. This replaces the query/create/update split implicated in #1174. The first visit seeds count one; later visits increment the stored count, preserve first access, and advance last access. The onboarding root guard now runs before either leg, and caller identity and detached-write lifetime tracking remain in place.

The real-mesh regression failed against the old handler in both cases: an absent stored activity became count 1000 from a stale query value of 999, and a stale positive allowed an activity to be persisted without an onboarded user root. The fix passes both. These are deterministic stale-index defects; the test does not claim to recreate the production 30-second timeout or add cluster-wide atomic counters.

The upsert response also retains structured conflict and hub-teardown classifications through an additive open-string FailureKind property, preserving the existing serialized enum and activity tracking's failure policy. Read, create, and update failures carry the classification on the actual response path; unknown kinds remain named, loud failures. A teardown with an unknown write outcome is distinct from a recycling intake refusal; neither introduces a retry. The CQRS page and canonical mesh-data skill now document the shipped folds and remove the stale #4928 blocker.

Validation: full solution Release build with CIRun=true and warnings as errors, zero warnings/errors; 59 focused activity, fold, refusal-wire and tracker tests plus the documentation link check passed, no skips. Coverage includes the real hub serializer and a future unknown failure kind. Independent review addressed failure-policy parity and evidence wording.

CI also exposed a race in the existing per-type bundle-hold fixture: it seeded an adoption after the source fingerprint appeared but before the initial compile completed, and that legitimate compile subsequently stamped Compiled. The fixture now waits for Ok, Compiled, and current/compiled source equality before seeding; every hold and provenance assertion is preserved. After that correction, the full Release solution again passed with zero warnings/errors, and 32 focused adoption/hold tests passed without skips.

Delivery: this is compiled core code and requires the supported platform image rollout. The rollout replaces the process-owned activity/_tracking hub; no NodeType content or per-node source recycle is required. Production verification will exercise repeated tracking and inspect the stored count and timestamps before closing #1174.

Copilot AI lite review requested due to automatic review settings September 22, 2026 06:03
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

  1 files  ±0    1 suites  ±0   2m 0s ⏱️ -7s
318 tests +4  318 ✅ +4  0 💤 ±0  0 ❌ ±0 
322 runs  +4  322 ✅ +4  0 💤 ±0  0 ❌ ±0 

Results for commit 32ff487. ± Comparison against base commit 2ea54ee.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

443 tests  ±0   443 ✅ ±0   37s ⏱️ -18s
  3 suites ±0     0 💤 ±0 
  3 files   ±0     0 ❌ ±0 

Results for commit 32ff487. ± Comparison against base commit 2ea54ee.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new serialized public enum members can break exhaustive consumers; use an open string vocabulary before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Moves activity tracking to an onboarding-gated owner-side upsert with serialized folds, replacing stale query-based create/update selection.

Changes:

  • Adds real-mesh regression tests for stale indexes, onboarding guards, folds, and failure classification.
  • Adds conflict and teardown rejection outcomes.
  • Documents the new fold-based upsert pattern.
File Description
test/​MeshWeaver.Graph.Test/​ActivityTrackingUpsertTest.cs Tests stale-index activity creation and folded tracking.
test/​MeshWeaver.Graph.Test/​ActivityConflictSeverityTest.cs Tests response failure classification.
src/​MeshWeaver.Mesh.Contract/​CreateNodeRequest.cs Adds upsert rejection outcomes and classification.
src/​MeshWeaver.Graph/​MeshNodeExtensions.cs Implements root-gated folded upserts.
src/​MeshWeaver.Documentation/​Data/​Architecture/​CqrsAndContentAccess.md Documents folded upserts.
.claude/​skills/​mesh-data/​SKILL.md Updates mesh-data guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/MeshWeaver.Mesh.Contract/CreateNodeRequest.cs Outdated
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

1 590 tests  ±0   1 590 ✅ ±0   3m 9s ⏱️ ±0s
    2 suites ±0       0 💤 ±0 
    2 files   ±0       0 ❌ ±0 

Results for commit 32ff487. ± Comparison against base commit 2ea54ee.

♻️ This comment has been updated with latest results.

@rbuergi
rbuergi marked this pull request as draft September 22, 2026 06:12
auto-merge was automatically disabled September 22, 2026 06:12

Pull request was converted to draft

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

723 tests  +3   531 ✅ +3   5m 35s ⏱️ +2s
  3 suites ±0   192 💤 ±0 
  3 files   ±0     0 ❌ ±0 

Results for commit 32ff487. ± Comparison against base commit 2ea54ee.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

    3 files  ± 0      3 suites  ±0   5m 53s ⏱️ ±0s
1 952 tests +14  1 952 ✅ +14  0 💤 ±0  0 ❌ ±0 
1 953 runs  +14  1 953 ✅ +14  0 💤 ±0  0 ❌ ±0 

Results for commit 32ff487. ± Comparison against base commit 2ea54ee.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

    5 files  ±0      5 suites  ±0   15m 29s ⏱️ +57s
3 907 tests +2  3 905 ✅ +2  2 💤 ±0  0 ❌ ±0 
3 911 runs  +2  3 909 ✅ +2  2 💤 ±0  0 ❌ ±0 

Results for commit 32ff487. ± Comparison against base commit 2ea54ee.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   17 files  ± 0     17 suites  ±0   32m 46s ⏱️ +33s
8 933 tests +23  8 739 ✅ +23  194 💤 ±0  0 ❌ ±0 
8 942 runs  +23  8 748 ✅ +23  194 💤 ±0  0 ❌ ±0 

Results for commit 32ff487. ± Comparison against base commit 2ea54ee.

♻️ This comment has been updated with latest results.

@rbuergi
rbuergi marked this pull request as ready for review September 22, 2026 06:25
@meshweaver-cloud
meshweaver-cloud Bot added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit ad17f6e Sep 22, 2026
37 checks passed
@rbuergi

rbuergi commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

#5187 replaces activity tracking's query/create/update split with the existing owner-side upsert and content folds, retaining caller identity, the onboarding guard, and the established failure policy. It merged as ad17f6e5c9f790e03a7f1433b851415cacc64dcf; its PR, merge-queue, and exact-main checks passed.

Production verification on memex.systemorph.com, image 3.0.0-ci.9162, core c55301f: the unchanged v2 rbuergi/Script/ActivityUpsertVerification0922 probe ran once on pod memex-portal-deployment-7f4f9b7689-d67t5. Activity rbuergi/_Activity/3f4f4f5ae06b4162a6ad37500aede087 reached Succeeded at 2026-09-22 09:57:41.5406039 UTC.

The durable count advanced 3 → 4 → 5 → 6. First access stayed 2026-09-22 06:20:29.8520151 UTC; the three last-access values advanced to 09:57:40.4872116, 09:57:40.7613836, and 09:57:41.1025923 UTC. A separate final node read confirmed count 6, version 6, the preserved first access, and lastModifiedBy: rbuergi. The script's final receipt identifies framework 3.0.0+c55301f396ef60e1a8a965334a407e433d97c553 and the pod above. Source equality was checked byte for byte before execution; no script change or repeat execution was needed.

The deterministic real-mesh regression establishes the stale-query defect: the old handler persisted count 1000 from a stale query value of 999 when durable activity storage was empty, and allowed a stale positive to bypass the missing-user-root guard. Both regressions pass with the fix. The live run is a production smoke check of the delivered path; it does not reproduce the historical 30-second timeout or establish a cause for every earlier timeout.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants