Skip to content

feat(events): support single-activity rolls and automatic winners - #35

Open
mwg-bender[bot] wants to merge 5 commits into
devfrom
feat/27-single-activity-rolls
Open

mwg-bender[bot] wants to merge 5 commits into
devfrom
feat/27-single-activity-rolls

Conversation

@mwg-bender

@mwg-bender mwg-bender Bot commented Sep 22, 2026

Copy link
Copy Markdown

Summary

  • Allow one-to-five activities and automatically persist the sole activity as winner.
  • Validate malformed, duplicate, incomplete, and out-of-range selections before writes.
  • Preserve customized dialog state on failed saves; distinguish successful saves with failed refreshes.
  • Cover create/edit, winner transitions, list/detail storage reads, filters, and slot rerolls.

Validation

Using DOTNET_ROOT=/opt/data/profiles/development/cache/scratch/dotnet-issue23-complete and DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1:

  • dotnet test MW-GC.EventManager.Tests/MW-GC.EventManager.Tests.csproj: 71 passed, 0 failed/skipped.
  • dotnet build MW-GC.EventManager.slnx: succeeded, 0 warnings/errors.
  • dotnet test MW-GC.EventManager.Tests/MW-GC.EventManager.Tests.csproj --filter FullyQualifiedName~SingleActivityApiTests: 39 passed.
  • dotnet test MW-GC.EventManager.Tests/MW-GC.EventManager.Tests.csproj --filter FullyQualifiedName~SlotRerollTests: 32 passed.
  • git diff --check: clean.

UI tests exercise component logic with mocked HTTP, not a live browser. Storage tests use mocked Azure Tables. No merge or deployment performed.

Publication audit

New publication supersedes closed, unmerged #34; #34 is not approval evidence. Final validation commit is authored by MWG Bender[bot]. Prior implementation commit 363d20e retains its existing Hermes Agent identity; published history was not rewritten. Base is explicitly dev, whose fetched tip is an ancestor of this branch.

Closes #27

hermes-agent and others added 2 commits September 22, 2026 00:37
Enforce one-to-five valid selections, normalize winners across edits, and retain dialog state on failed saves. Cover API persistence and UI save and reroll regressions for issue #27.

Copilot AI left a comment

Copy link
Copy Markdown

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

Three unresolved moderate findings affect malformed data handling, import normalization, and refresh error handling.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds support for 1–5 activity events, automatic single-activity winners, stronger validation, and improved save handling.

Changes:

  • Added winner normalization and selection validation.
  • Improved UI slot management and save/refresh error handling.
  • Expanded API/UI tests and repository documentation.
File Summary Final review notes
MW-GC.EventManager.Web/​Pages/​Events.razor Supports single-slot events and save errors. Moderate issue (2 votes): refresh JsonException is not handled.
MW-GC.EventManager.Tests/​SlotRerollTests.cs Adds slot and save-flow coverage. No final comments.
MW-GC.EventManager.Tests/​SingleActivityApiTests.cs Adds API and persistence coverage. No final comments.
MW-GC.EventManager.Tests/​MW-GC.EventManager.Tests.csproj Adds test dependencies. No final comments.
MW-GC.EventManager.Shared/​Entities/​EventEntity.cs Adds selection validation and winner rules. Two moderate issues (1 vote each): null nested collections are accepted, and imported single-activity events may lack normalized winners.
MW-GC.EventManager.API/​Services/​EventGenerator.cs Enforces selection bounds. No final comments.
MW-GC.EventManager.API/​Properties/​AssemblyInfo.cs Exposes internals to tests. No final comments.
MW-GC.EventManager.API/​Functions/​EventFunctions.cs Validates requests and normalizes winners. No final comments.
docs/​agents/​triage-labels.md Documents triage labels. No final comments.
docs/​agents/​issue-tracker.md Documents issue workflow. No final comments.
docs/​agents/​domain.md Documents domain context. No final comments.
AGENTS.md Documents repository guidance. No final comments.

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

Comment thread MW-GC.EventManager.Web/Pages/Events.razor Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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

Retrying an ambiguous create failure can submit a duplicate event because creates are not idempotent.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)

Comment thread MW-GC.EventManager.Web/Pages/Events.razor
Retain a per-dialog request key and use atomic table inserts so a lost response cannot create a second event. Reconcile matching retries and reject changed payloads without overwriting saved data.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

An unresolved import-path winner-normalization issue remains, alongside UI and documentation fixes.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

Comment on lines +1 to +7
# Customized event create retries

`POST /api/events` accepts an optional `Idempotency-Key` header containing one non-empty GUID in `D` format. The key becomes the event ID; body IDs remain ignored. The UI generates a key for each create dialog and retains it across failed saves, including lost responses and timeouts. Updates still use PUT.

The API uses Azure Table Storage's atomic insert, not upsert or a read-before-write check. An existing row cannot be replaced by a retry. An identical normalized payload returns the existing event (200); a new insert returns 201. If the stored details differ, the API returns 409 with instructions to reload and edit the saved event. Invalid keys return 400. Requests without a key retain legacy server-generated IDs and are not retry-safe.

The event row itself is the deduplication record, so protection lasts while that row exists. This is not a durable request ledger: reopening the dialog or reloading the browser starts a new create, and replay after deletion can recreate the same ID. The generated-event endpoint is unchanged. Deploy the API support before the updated UI; an older API ignores the header.

This branch has not been deployed

No deployments
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