Skip to content

fix(actions): singleton registration + ADR-0033 upsert + Lambda runbook - #166

Merged
eldonm merged 2 commits into
devfrom
feat/adr-0033-upsert-lambda-runbook
Sep 1, 2026
Merged

fix(actions): singleton registration + ADR-0033 upsert + Lambda runbook#166
eldonm merged 2 commits into
devfrom
feat/adr-0033-upsert-lambda-runbook

Conversation

@eldonm

@eldonm eldonm commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

Closes duplicate AccessControlAction (and other singleton) nodes under concurrent Lambda cold starts.

Commit 1 — singleton enforcement (c9a17682)

  • Raw-record identity lookup in register_action (bypasses Action.find_one subclass filter)
  • Collapse duplicate singletons by archetype; reject second label; post-save race loser drop
  • Boot _dedupe_singleton_actions_by_archetype

Commit 2 — ADR-0033 extraction + ops (06e8c098)

  • jvagent/core/upsert.pyupsert_lookup_by_action_identity, upsert_lookup_by_singleton_archetype
  • jvagent/action/registration.pyresolve_action_for_registration, reconcile_singleton_after_create
  • Runbook: .planning/runbooks/multi-container-bootstrap.md
  • docs/environment-keys-reference.md — distributed locking keys

Supersedes #163 (same branch stack).

Ops (required for Lambda)

Set JVAGENT_CONVERSATION_LOCK_REDIS_URL (same Redis as turn-lock) so bootstrap serializes across containers. See runbook.

Test plan

  • pytest tests/action/test_singleton_registration.py tests/core/test_action_dedupe.py tests/core/test_upsert_identity.py
  • Configure Redis on staging Lambda; scale-out burst → one AC node per agent
  • jvagent /path/to/app --update to heal existing dupes
  • CloudWatch: no Multiple AccessControlAction nodes after deploy

Made with Cursor

Eldon Marks and others added 2 commits September 1, 2026 11:27
Concurrent Lambda boots could create multiple AccessControlAction nodes
because register_action relied on Action.find_one (subclass-filter blind spot)
and singleton guard only rejected different labels. Resolve existence via raw
DB records, collapse duplicate archetypes before create, reject second labels,
and drop race losers after save. Boot also dedupes singletons by archetype.

Co-authored-by: Cursor <cursoragent@cursor.com>
Extract upsert_lookup_by_* into jvagent/core/upsert.py and
resolve_action_for_registration into action/registration.py; refactor
register_action to use them. Document JVAGENT_CONVERSATION_LOCK_REDIS_URL
for multi-container bootstrap in runbook and environment-keys-reference.

Co-authored-by: Cursor <cursoragent@cursor.com>
@eldonm
eldonm changed the base branch from main to dev September 1, 2026 15:50
@eldonm eldonm self-assigned this Sep 1, 2026
@eldonm
eldonm merged commit 9092ec2 into dev Sep 1, 2026
3 checks passed
@eldonm
eldonm deleted the feat/adr-0033-upsert-lambda-runbook branch September 1, 2026 15:53
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.

1 participant