Skip to content

fix(ten-427): check github-links document as primary issue-matching strategy#17

Merged
lavie merged 1 commit into
ten-334-github-webhook-dispatcherfrom
ten-427-webhook-pr-fallback
May 6, 2026
Merged

fix(ten-427): check github-links document as primary issue-matching strategy#17
lavie merged 1 commit into
ten-334-github-webhook-dispatcherfrom
ten-427-webhook-pr-fallback

Conversation

@marvin-tensorleap

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #16 (branch/title identifier fallback). Implements the primary matching strategy specified in TEN-427:

  • manifest.ts: added issue.documents.read capability
  • findTenIssue in worker.ts: for each text-search candidate, check its github-links document first (primary path). If the prs array contains the incoming ref → dispatch immediately. Falls back to title/description text match only when no github-links hit is found.
  • tests/plugin.spec.ts: 2 new tests — (1) github-links primary path succeeds, (2) github-links doc lists a different PR so fallback to description fires. buildHarness gains issue.documents.write so tests can seed documents.

Full priority order after this change:

  1. github-links document match (primary — authoritative canonical mapping)
  2. Title/description text match (fallback — for issues where github-links wasn't maintained)
  3. PR branch/title TEN-NNN identifier (from fix(ten-427): fall back to PR branch/title for TEN issue matching #16 — final fallback for agent rule violations)
  4. Triage issue creation (no match found)

Test run: 24/24 pass.

Note on harness vs production: The test harness text search scans title/description/identifier only (document content not indexed). In production, document content is full-text indexed, so issues with only a github-links entry (no description ref) surface in the initial text search and are matched via the github-links check. The harness tests the github-links check logic on text-search candidates. The branch/title fallback covers the pure "agent never updated github-links or description" case in both environments.

🤖 Generated with Claude Code

…trategy

The previous code checked title/description text only, ignoring the
github-links document which is the authoritative PR→issue mapping.
When an agent followed the rule and added a PR to an issue's github-links
doc but not to the description, the dispatcher would miss the match.

Changes:
- manifest: add issue.documents.read capability
- findTenIssue: for each text-search candidate, check github-links document
  first (primary); fall back to title/description only if no github-links
  match is found. The production server full-text-indexes document content so
  issues whose github-links doc lists the ref will appear in the text search.
- tests: add two new cases — one verifying the github-links primary path
  succeeds, one verifying the description fallback fires when the github-links
  doc lists a different PR. buildHarness gains issue.documents.write so tests
  can seed documents via upsert.

The branch/title fallback (from the previous commit) remains as a third-level
fallback for cases where neither github-links nor description text contain the
ref (e.g. agent never updated either).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@marvin-tensorleap marvin-tensorleap force-pushed the ten-427-webhook-pr-fallback branch from 08beff9 to a8100f5 Compare May 6, 2026 11:41
@lavie lavie merged commit 3656ea0 into ten-334-github-webhook-dispatcher May 6, 2026
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.

3 participants