Skip to content

docs(#9586): add entity discovery v1 normative contract - #9828

Merged
ifireball merged 2 commits into
mainfrom
agent/9586-entity-discovery-contract
Nov 24, 2026
Merged

ifireball merged 2 commits into
mainfrom
agent/9586-entity-discovery-contract

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Adds the versioned normative contract docs/normative/entity-discovery/v1/README.md. It covers runtime entity discovery: how a fullsend poll pass lists candidates for entity sources that are already configured. It answers the four questions in #9586 (complete scans, safe progress, recovery, and invalidation) and maps each rule to numbered conformance cases. It builds on ADR 0149, ADR 0079, and entity-source configuration v1. It adds no source model, configuration field, or query language.

Related Issue

Implements the maintainer decisions in the latest comment on the issue. The closed PR #9590 was not reused.

Changes

  • Pass outcomes. A pass is complete, incomplete, failed, or unsupported. Only a complete pass with zero candidates counts as complete-empty. A last page, an empty page, a result cap, or a missing total count never proves completeness. An entity missing from the results is never treated as a non-match. A complete pass is not a point-in-time snapshot.
  • Coverage evidence. A partition is complete only with all five of: an end-of-results signal, proof it is below every result cap, a page traversal that cannot skip entities (consistent cursor, stable key, keyset bounds, or overlap with reconciliation, plus handling for sort-key ties), partitions that together cover everything, and a recorded "settled boundary" that allows for search-index lag.
  • Progress. v1 has no durable checkpoint, watermark, or persistent inventory. Coverage claims use only evidence from the current pass. Cross-process hints may change ordering but cannot mark a range complete. Candidates are processed as pages arrive.
  • Ordering and rate limits. Freshness-first ordering is used where supported, and it never changes which entities match. Provider backoff guidance is followed. A pass interrupted by rate limits is reported as incomplete/rate_limited.
  • Recovery. Retry is in memory only, with fairness between retries and new passes and honest reporting when retries run out. After a restart, a fresh pass relies on recurring discovery (ADR 0144). This meets the Authorization v2 "durable retry or proven rediscovery" requirement. Older candidates are backfilled through a rotation that survives restarts, which matters because poll defaults to the once lifecycle. There is no global catch-up deadline.
  • Plan changes. Lists what feeds the plan identity. When the plan changes mid-pass, the pass replans and the old coverage is discarded. Cached normalized entities are not invalidated. Time-dependent selections need recurring full rediscovery.
  • Boundaries. A one-cycle fullsend run for a known entity is not gated by this contract. Event-only harnesses and the ADR 0063 event-reconstructing drivers are unaffected. The Activation section states that this contract does not enable scheduled or entity-driven execution on its own.
  • Provider limits. A table covers GitHub, GitLab, Forgejo (reported unsupported until an adapter passes conformance), and Jira, listing only limits that affect the guarantees.
  • Conformance cases DC-1 to DC-25.
  • Adds one-line pointers to the new contract from docs/architecture.md and from entity-source configuration v1. The VitePress sidebar finds docs/normative/ automatically, so no config change was needed.

Testing

  • make lint hooks pass for the changed files. pre-commit could not fetch its remote hook repositories in the sandbox (TLS certificate failure), so the applicable hooks ran directly instead: the pre-commit-hooks 6.0.0 file checks, lint-broken-symlinks, lint-docs-links, and the offline lychee link and anchor check. scan-secrets also passed.
  • Tests added/updated for new or modified logic. Not applicable: this is a documentation-only change.

Review notes

  • Provider-limit statements use cautious wording. Each adapter must verify them against the deployed provider version. Please check the Jira enhanced-search consistency note and the GitLab total-count header note.
  • ADR 0149 allows marking uncertain coverage complete when a durable retry is recorded. This contract is stricter because it has no durable retry: uncertain coverage always stays incomplete.

Checklist

  • PR title follows Conventional Commits
  • Commits are signed off (DCO): not applicable, autonomous agent commit

🤖 Generated with Claude Code


Closes #9586

Post-script verification

  • Branch is not main/master (agent/9586-entity-discovery-contract)
  • Secret scan passed (gitleaks — ff203b943d8a75516b7ca2435a8a034627a662e8..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Final PR description secret scan passed (gitleaks — no-git)

Add docs/normative/entity-discovery/v1/README.md. It defines the
runtime guarantees for fullsend poll when it enumerates candidates
for configured entity sources, as ADR 0149 requires. It consumes the
effective selections from ADR 0079 and entity-source configuration
v1 and adds no source model or query language.

The contract defines complete, incomplete, failed, and unsupported
pass outcomes. Only a complete pass with no candidates is
complete-empty. Last pages, empty pages, and caps never prove
completeness, and absence from results is never non-membership.
It specifies page traversal and partitioning rules, settled
boundaries for delayed indexing, freshness-first ordering, and
rate-limit interruption.

Recovery uses in-memory retry only, with no durable checkpoint or
inventory. Recurring discovery and a restart-safe older-candidate
backfill rotation recover uncovered work. Plan changes replan the
active pass without invalidating cached normalized entities, and
time-dependent selections need recurring full rediscovery. Provider
limits for GitHub, GitLab, Forgejo, and Jira are recorded where they
affect these guarantees. Conformance cases DC-1 to DC-25 map each
rule to observable adapter behavior.

Link the contract from docs/architecture.md and from entity-source
configuration v1.

Note: pre-commit could not fetch remote hook repositories (TLS
certificate failure). The applicable hooks ran directly instead:
pre-commit-hooks 6.0.0 file checks, lint-broken-symlinks,
lint-docs-links, lychee offline link checks, and scan-secrets.

Closes #9586

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner November 24, 2026 10:10
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Nov 24, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:13 AM UTC · Completed 10:25 AM UTC

Commit: 274668f · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.39

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://f0f08c3a-site.fullsend-ai.workers.dev

Commit: 2a0d64a9aa1ec589aca54f4f20b0a4ae28f7618f

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 24, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Documentation-only PR by a bot with no protected paths, assigned moderate risk due to diff size (612 lines) and high recent churn on docs/architecture.md.

Previous run

Risk Assessment: moderate (2/5)

Details

Documentation-only PR by a bot with no protected paths, assigned moderate risk due to diff size (576 lines) and high recent churn on docs/architecture.md.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Looks good to me

Previous run

<!-- fullsend:review-findings-v2:eyJ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ZfMTU1MjQ5YzE4Mzg2YzkxMyIsImxpbmUiOjQ5MiwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJpbmNvbXBsZXRlLWRvYyIsImZpbGUiOiJkb2NzL3Byb2JsZW1zL2FnZW50LWFyY2hpdGVjdHVyZS5tZCIsImlkIjoiZl9iMDc3ZWUwOTdhMmE4MTE0IiwibGluZSI6MTYwLCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiZG9jcy1jdXJyZW5jeSJ9XX0= -->

Review

Findings

Medium

  • [logic-error] docs/normative/entity-discovery/v1/README.md:181 — The accepted "Stable key" traversal method does not establish the required no-skips guarantee under offset pagination. With IDs [1,2,3,4] and page size 2, if entity 1 is deleted or stops matching after page 1, the next offset returns [4] and entity 3 (which matched throughout) is skipped. Immutable ordering and the restriction on new entities both still hold, so the method cannot supply completeness evidence.
    Remediation: Require stable-key ordering to be paired with keyset bounds, a consistent snapshot, or reconciliation that accounts for removals and membership changes before the current offset. Add this removal scenario to DC-7.
  • [logic-error] docs/normative/entity-discovery/v1/README.md:312 — Bounded partition visits do not prove the eventual rediscovery that the recovery section claims. With no persistent progress, an adapter can rotate older partitions across fresh processes, spend its backfill budget on the first page of each, and never reach an unresolved candidate deeper in a partition. Every partition is "visited" within the bound and DC-18 passes, yet that candidate is starved.
    Remediation: Require eventual exhaustive traversal of each backfill range (e.g., restart-independent subpartition rotation whose selected subpartitions can complete, or equivalent reconciliation). Strengthen DC-18 to verify rediscovery of a candidate beyond the repeatedly visited first pages.
  • [test-inadequate] docs/normative/entity-discovery/v1/README.md:492 — Mandatory conformance cases strengthen optional runtime behavior. DC-13 requires routing before later pages are fetched, but early processing is MAY (Progress within a pass) / SHOULD (Ordering and processing). DC-15 requires processing already-found candidates, but the rate-limit rule says MAY. DC-16 requires oldest-first retries, but the retry rule says SHOULD. Since every case is mandatory, implementations using the permitted alternatives cannot conform.
    Remediation: Align DC-13, DC-15 and DC-16 with the normative requirement levels (test the optional behavior conditionally and keep the permitted exceptions to oldest-first scheduling), or explicitly strengthen the corresponding runtime requirements.

Low

  • [incomplete-doc] docs/problems/agent-architecture.md:160 — The passage on ADR 0149 discovery/candidate routing (lines 148–164) already links sibling normative contracts but has no link to the new entity discovery contract. This is a discoverability suggestion rather than a strict AGENTS.md requirement.
    Remediation: Optionally add a contextual link to [Entity discovery v1](../normative/entity-discovery/v1/README.md) near line 160.

Labels: PR adds and updates documentation


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the component/docs User-facing documentation label Nov 24, 2026
@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 10:27 AM UTC · Completed 10:30 AM UTC

Commit: 274668f · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.27

@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Require keyset/snapshot/reconciliation for page traversal and add the
removal scenario to DC-7, require exhaustive backfill traversal and
strengthen DC-18, align DC-13/15/16 with optional runtime requirements,
and link the contract from agent-architecture.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (bot-triggered)

Addressed all four review findings in the entity discovery v1 contract and the agent-architecture problem doc. Pre-commit could not run because the sandbox has no network access to fetch hooks, and the offline link checker was unavailable. The secret scan passed. The new link and anchor were checked by hand.

Fixed (4):

  1. Stable-key traversal does not guarantee no skips under offset pagination (docs/normative/entity-discovery/v1/README.md): Merged the stable-key method into keyset bounds over a stable key, stated that immutable ordering with offset pagination is insufficient, added a consistent-snapshot method, extended reconciliation to removals and membership changes, updated the Jira provider row, and added the removal scenario to DC-7.
  2. Bounded partition visits do not prove eventual rediscovery (docs/normative/entity-discovery/v1/README.md): Added a requirement that every backfill range is eventually traversed exhaustively, with examples, and strengthened DC-18 to check rediscovery of a candidate beyond the first pages.
  3. Mandatory conformance cases DC-13, DC-15, DC-16 strengthen optional behavior (docs/normative/entity-discovery/v1/README.md): Made early routing (DC-13), processing of found candidates (DC-15), and oldest-first retry (DC-16) conditional so they are checked only where the adapter uses that behavior; runtime requirement levels are unchanged.
  4. Missing link to the entity discovery contract in the ADR 0149 passage (docs/problems/agent-architecture.md): Added a contextual link to Entity discovery v1 in the discovery and candidate routing passage.

Tests: passed

CI inspections (5):

  1. CI / test (passing, success)
  2. CI / commit-lint (passing, success)
  3. CI / semgrep (passing, success)
  4. PR Title Lint / pr-title-lint (passing, success)
  5. behaviour-github-emulator (agents) (pending, in_progress): Still running at inspection time; docs-only PR.

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push

Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:33 AM UTC · Completed 10:40 AM UTC

Commit: 2a0d64a · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.16

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Nov 24, 2026
@ifireball
ifireball added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit c490b50 Nov 24, 2026
73 checks passed
@ifireball
ifireball deleted the agent/9586-entity-discovery-contract branch November 24, 2026 12:24

This branch was successfully deployed

1 active and 1 inactive deployments
site-preview — 2a0d64a9 Deployed Nov 24, 2026 by github-actions[bot]
forgejo-dev — 2a0d64a9 Deployed Nov 24, 2026 by fullsend-ai-coder[bot] via forgejo-behaviour #21095
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/docs User-facing documentation ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specify entity discovery completeness and recovery guarantees (ADR 0149)

1 participant