Skip to content

feat(lease): add patterned inventory observation - #11

Open
smiggleworth wants to merge 1 commit into
mainfrom
lease-patterned-subscribe-and-list
Open

feat(lease): add patterned inventory observation#11
smiggleworth wants to merge 1 commit into
mainfrom
lease-patterned-subscribe-and-list

Conversation

@smiggleworth

Copy link
Copy Markdown
Contributor

Why are you making this contribution?

The coordinated Lease inventory contract in cntryl/fitz#219 requires Go consumers of the public fitz package to list patterned held-lease state and use a race-safe observer. Review found that the initial LIST implementation was internal-only and that async notification dispatch left a bootstrap installation race.

Related issue

Part of cntryl/fitz#219. Broker counterpart: cntryl/fitz#221.

What does this change do?

  • Exposes LIST entries/options and a closable iterator through the public fitz.LeaseClient adapter, including public 5011/5012 errors.
  • Adds a public closable inventory observer with subscribe-before-list bootstrap, stable invalidation draining, coalesced full relists, periodic jittered reconciliation, and reconnect recovery.
  • Adds synchronous notification invalidation before async handler dispatch to close the acknowledgement/pagination race.
  • Accepts generic non-adjacent ** selector compositions while rejecting adjacent ** locally.
  • Covers both the internal implementation and an external-consumer public surface.

Validation

  • gofmt -d .
  • go vet ./...
  • go test ./... -timeout 120s
  • go test -race ./... -timeout 180s

Risk and compatibility

The public API is additive and existing exact Lease mutation operations remain exact-only. LIST requires cntryl/fitz#221. Observers intentionally perform full LIST reconciliation after invalidations and periodically, so broad selectors trade higher read cost for convergence and must be closed when no longer needed.

Tool assistance disclosure

Select exactly one:

  • No AI or other generative tool materially assisted this contribution.
  • AI or another generative tool materially assisted this contribution.

OpenAI Codex assisted with implementation, cross-repository review, regression-test construction, and validation orchestration. I reviewed the complete diff and exercised the repository gates and focused Lease scenarios.

Contributor responsibility

  • I understand the complete change and can explain or revise it.
  • I reviewed the complete diff.
  • I reported validation accurately and did not claim checks I did not run.
  • I disclosed material generated assistance.
  • I have the right to submit this work under the repository's license.

Copilot AI lite review requested due to automatic review settings August 31, 2026 19:12

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

@smiggleworth
smiggleworth force-pushed the lease-patterned-subscribe-and-list branch from 3b0900f to 122aaa7 Compare August 31, 2026 19:15
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