Skip to content

Require opt-in before adopting cited GitHub issue items - #169

Merged
unbraind merged 20 commits into
mainfrom
feat/cited-issue-adoption
Oct 23, 2026
Merged

unbraind merged 20 commits into
mainfrom
feat/cited-issue-adoption

Conversation

@unbraind

@unbraind unbraind commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

GitHub issue import now keeps normal create behavior unless citation adoption is explicitly enabled. The default path reports read-only citation_candidates so agents can tag the right item. The primary prevention is creating issue items with gh:owner/repo#N tags.

Encoded second references such as [other](https://github.com/other/widgets/issues/31) and issues%2F31 bypassed the earlier raw/strict parsers. This changes the ownership contract instead of enabling automatic adoption for arbitrary prose.

  • Explicit opt-in: CLI --adopt-cited, SDK adoptCited: true, reusable sync input adopt-cited: true. Every default is false. Preview, gated import and repeat verification receive the same setting. Default imports neither adopt nor refuse fallback ambiguity; established structured-identity collision checks remain unchanged.
  • Normalize before citation checks: decode named/numeric HTML entities and percent bytes repeatedly until stable, bounded to eight passes; apply NFKC and remove invisible/bidi controls. Unwrap Markdown destinations/reference definitions and join soft breaks for ownership matching. Retain normalized source alongside the display/joined views for conservative exclusion so link labels and definitions cannot disappear. Bound exhaustion refuses adoption. Full HTML decoding uses pinned runtime dependency entities@8.1.0; existing pins and thresholds are unchanged.
  • Anchored positive ownership: a qualified target reference in the title, a supported Fix/Close/Resolve word followed by it at the start of the description, or a whole body line Issue: <url> / Tracks: <url>. Unanchored descriptions, body fix phrases and Related mentions are candidates only.
  • Conservative exclusion: any other normalized GitHub URL, foreign repository, other number or UNKNOWN reference refuses adoption. This includes PR URLs with the same number and bare hashes without verified owning-repository context. Arbitrary prose remains weaker evidence than a provenance tag; conservative refusals retain normal creates.

Tag/structured URL/provider matching keeps precedence. With opt-in, one eligible owner receives an adopt plan and normal upsert; two eligible owners refuse the batch with typed ambiguous_citation, candidate IDs and a tagging remedy. Closed/canceled issue owners remain eligible. Dry-run reports adopts, receipts report adopted, and gated idempotency counts one landing item. Default hints never change the referenced item's fields or status.

Acceptance criteria Evidence
Default creates match main; candidate reporting is read-only Plain/atomic real no-git tests with opt-in false, completed local-item preservation, and competing eligible candidates without fallback refusal
Explicit opt-in works across CLI/SDK/workflow Four non-git mode combinations; packed installed CLI uses a body-only Issue: item; real workflow shells execute preview, import and repeat for omitted/false/true input
All review reproductions refuse unsafe adoption Related-only, two-issue roadmap, trailing slash, emphasis, same-number foreign repository, &sol; and %2F
Normalization and allowlist have positive controls All closing keywords, body URL labels, title references, named/numeric entities, percent nesting, Unicode/control handling, Markdown inline/reference links, soft label breaks and bounded refusal
Generated second references never authorize adoption Seed 0x53ce71a9: 4,096 repository/number/decoration/encoding samples across three fields, 12,288 cases; earlier matrices remain
Existing issue ownership still adopts deliberately Pre-tag pm-review dry-run plans 1 adopt with explicit opt-in and 1 create + adoption_disabled hint by default

All four mandatory PM-linked commands passed with no failures/skips: adoption 44/44, regex/performance 8/8, executable workflow 4/4, packed CLI 1/1. An additional complete selector/fidelity sweep passed 80/80. Typecheck, builds, lint, docstrings, zero duplication, privacy, strict tracker health and changelog generation/check passed locally. Scoped coverage found no uncovered branches in the new normalization/exclusion/allowlist functions.

Behavioral revert proofs use current tests and real persistence in an isolated source copy:

Restore from 0b4bc29 Command Reverted result
Only matchImportedIssue node --test --test-name-pattern='explicit opt-in (false|defaults)' test/cited-issue-adoption.test.ts 3 failures, 0 passes/skips, exit 1
Only citesIssue and its prior raw helper node --test --test-name-pattern='normalized allowlist' test/cited-issue-adoption.test.ts 4 failures, 0 passes/skips, exit 1
Only reusable sync YAML node --test --test-name-pattern='reusable workflow.*(explicit opt-in|adoption input)' test/import-gate.test.ts 2 failures / 2 passes, 0 skips, exit 1

The workflow proof packs a real copy of current compiled output: true loses adoption, the input contract fails, and the two default executions still pass. Fixed selections pass. Proofs and prior review evidence are recorded on the PM item.

Saved public tracker archives were replayed read-only with live GitHub issue/timeline reads:

Snapshot / selection Default: create / update / adopt Opt-in: create / update / adopt
pm-review pre-tag f72250e4c5ee8dfafaf57ee8afe20ddd3cbc993e, issue 30 1 / 0 / 0 0 / 0 / 1 into pm-review-withdrawn-lineage
pm-review tagged e1fc83a81507ca6a91f1675b74863c050f1a89f1, issue 30 0 / 1 / 0 0 / 1 / 0
pm-context 7d7479ae77c13d01c54b2b4560ad54091ffed788, issues 154/153/136/53/81 2 / 3 / 0 2 / 3 / 0

All modes report zero skips; pm-context retains three multiple_issues hints. All 393/393 original tracker files retain identical SHA-256 hashes after both modes. These are saved revisions, not a claim about latest repository mains. Validation details include the adopt entry and exact commands.

Exact-head npm/Bun CI release gates and CodeQL are pending. Their completed run links and counts will replace this paragraph before handoff.

Commit 6adb234 contains code, reusable workflow, regression tests, README/validation/caller docs, regenerated changelog and PM history together. Commit 51dea17 removes an unnecessary overlapping trailing match flagged by CodeQL in Markdown definition normalization, with no rule suppression or threshold changes. All linked checks passed again after that cleanup. Commit 894dbdb keeps distinct normalized/source/joined views but scans equal views once, scans marker positions before reading adjacent repositories, and skips only identity formatting transforms. This addresses the unchanged 50 ms native ownership budget (85.562 ms before optimization in CI; local fixed 22.892 ms). Restoring only the three changed performance functions from 51dea17 makes the selected native probe fail at 112.322 ms, 1 failure / 0 passes / 7 filtered. No threshold was relaxed. Current Node source checks pass 52/52 and native local Bun regex checks 8/8, with no uncovered new-helper branches. The public replay was re-run unchanged after this optimization. Independent re-review remains pending; skipped or unavailable reviewers do not establish approval.

PM: pm-github-cited-issue-adoption, left in progress with the claim released. Existing overlap: import fidelity, identity diagnosis/repair. Incident: pm-review-withdrawn-lineage.

Summary by Sourcery

Require explicit opt-in for conservative GitHub issue citation adoption while preserving normal creates and surfacing actionable candidate hints by default.

New Features:

  • Add explicit opt-in citation adoption for GitHub issue imports across the CLI, SDK, and reusable workflow, with adoption plans and receipts.
  • Report read-only citation candidates when adoption is disabled and provide typed ambiguity refusals when multiple eligible owners exist with opt-in enabled.

Bug Fixes:

  • Prevent encoded, formatted, foreign, unrelated, or ambiguous GitHub references from authorizing unsafe ownership adoption.

Enhancements:

  • Strengthen citation ownership matching with bounded normalization, anchored intent rules, conservative exclusions, and precedence for existing structured ownership.
  • Expose adoption and candidate information consistently in dry-run, import, gated idempotency, and repeat-import results.

Build:

  • Pin the HTML entity decoding dependency used by citation normalization.

CI:

  • Extend workflow and CLI validation for the citation adoption option and its default-off behavior.

Documentation:

  • Document citation adoption controls, conservative matching rules, provenance tagging guidance, and validation results.

Tests:

  • Add comprehensive regression, normalization, ambiguity, workflow, CLI, persistence, and performance coverage for citation adoption.

Chores:

  • Record the feature and validation history in the project management tracker and changelog.

@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Sorry @unbraind, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 20 hours and 38 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0ce00ea2-f214-4a2b-8f01-a69f1b673176
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR changes GitHub issue import identity resolution to adopt one eligible existing item citing the exact issue, while preserving structured ownership precedence and adding strict ambiguity/no-write safeguards, opt-out support, distinct adoption accounting, comprehensive CLI/atomic/gated regression coverage, and validation documentation.

Sequence diagram for a gated citation adoption import

sequenceDiagram
    participant CLI
    participant Importer
    participant Tracker
    participant GitHub

    CLI->>Importer: runImport
    Importer->>GitHub: fetch issue
    Importer->>Tracker: read existing items
    Importer->>Importer: matchImportedIssue
    alt one exact citation candidate
        Importer->>Importer: build adopt plan
        Importer->>Importer: verifyImportIdempotency
        Importer->>Tracker: upsert existing item with provenance
        Tracker-->>Importer: landing item updated
        Importer-->>CLI: adopted count and gate receipt
    else multiple citation candidates
        Importer-->>CLI: ambiguous_citation with candidate IDs
        Note over Importer,Tracker: No tracker write occurs
    end
Loading

State diagram for GitHub issue import identity

stateDiagram-v2
    [*] --> StructuredMatch
    StructuredMatch --> Reused: tag, URL, or provider ownership
    StructuredMatch --> CitationSearch: no established owner
    CitationSearch --> NewItem: no exact citation
    CitationSearch --> Adopted: one eligible citation
    CitationSearch --> Blocked: multiple citations
    CitationSearch --> NewItem: --no-adopt-cited
    Reused --> Upserted
    Adopted --> Upserted
    NewItem --> Upserted
    Blocked --> [*]
    Upserted --> [*]
Loading

Flow diagram for cited GitHub issue adoption

flowchart TD
    A["Prepare GitHub issue import"] --> B{"Structured identity match?"}
    B -->|Yes| C["Reuse established owner"]
    B -->|No| D{"Citation adoption enabled?"}
    D -->|No| E["Create new item"]
    D -->|Yes| F["Find exact URL or owner/repo#N citation"]
    F --> G{"Candidate count"}
    G -->|0| E
    G -->|1| H["Adopt existing item"]
    G -->|2 or more| I["Refuse batch: ambiguous_citation"]
    C --> J["Normal upsert and provenance fields"]
    H --> J
    E --> J
Loading

File-Level Changes

Change Details Files
Add citation-based identity resolution so imports adopt an existing local item instead of creating a duplicate.
  • Match exact GitHub issue URLs or repository-qualified shorthand across title, description, and body, with strict boundary and punctuation handling.
  • Preserve precedence for provenance, structured ownership, and provider links; exclude pull requests and items with existing provenance tags from the fallback.
  • Keep terminal items eligible and apply normal provenance and GitHub field upserts while retaining local context.
  • Add an opt-out flag for reference-only citations and expose the behavior through CLI parsing and documentation.
import-fidelity.ts
index.ts
README.md
Make citation adoption safe, reviewable, and idempotent across import modes.
  • Plan all issues before mutation, refuse the whole batch on ambiguous citations, and report candidate IDs plus a tagging remedy.
  • Detect conflicting adoption targets and verify adopted items receive provenance before allowing gated or atomic writes.
  • Represent adopts separately from creates and updates in plans, dry-run output, receipts, and gated idempotency counts.
  • Reuse the same planner for plain, atomic, dry-run, gated, and scheduled import flows.
index.ts
import-fidelity.ts
Add regression coverage and validation documentation for adoption behavior.
  • Cover single and terminal-item adoption, retries, ambiguity no-write behavior, matching boundaries, ownership precedence, provider behavior, opt-out, and conflicting targets.
  • Exercise real initialized trackers with and without Git, built-package CLI dispatch, atomic imports, and gated receipts.
  • Document public tracker replay results, unchanged source-file checksums, validation boundaries, and behavioral revert evidence.
test/cited-issue-adoption.test.ts
test/import-fidelity.test.ts
test/import-gate.test.ts
test/import-selection.test.ts
test/atomic.test.ts
test/dryrun-preview.test.ts
test/import-errors.test.ts
docs/cited-issue-adoption-validation.md
Update project metadata and user-facing release documentation.
  • Record the feature in the changelog and add its PM feature/history artifacts.
  • Document the new flag, matching semantics, ambiguity handling, dry-run behavior, receipts, gate behavior, and non-git limitations.
CHANGELOG.md
.agents/pm/features/pm-github-cited-issue-adoption.toon
.agents/pm/history/pm-github-cited-issue-adoption.jsonl
README.md

Possibly linked issues

  • #unknown: The PR changes dry-run output to separate the action from the title and avoids the dangling comma when labels are absent.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@unbraind unbraind left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

VERDICT: BLOCK
FINDINGS:

  • [blocking] import-fidelity.ts:68 — Citation matching never checks fix/track intent — an untagged closed item containing only Related: acme/widgets#30 is adopted, letting import overwrite its content and reopen it when issue 30 is open.
  • [blocking] import-fidelity.ts:71 — The matcher accepts any matching reference without excluding items citing several issues — importing only issue 30 adopts a roadmap containing acme/widgets#30 and acme/widgets#31, bypassing the batch conflicting-target check and allowing issue 30 to close the roadmap.
    SUMMARY: The PR adds default citation adoption, ambiguity refusal, adoption receipts, and an opt-out while retaining structured matching precedence. The inspected tests cover positive adoption, retries, ambiguity, and batch target conflicts, but omit incidental mentions and single-issue imports against multi-issue items; tests were not run.

Review by a read-only codex review agent (gpt-6.1-sol), posted by the orchestrator; the PR returns to its author agent for the fixes.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@unbraind unbraind changed the title Reuse existing items that cite an imported GitHub issue Reuse single-issue work items during GitHub issue import Oct 23, 2026

@unbraind unbraind left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

VERDICT: BLOCK
FINDINGS:

  • [blocking] import-fidelity.ts:81 — The regex ignores second-issue URLs ending in /, so Fixes acme/widgets#30 and https://github.com/acme/widgets/issues/31/ incorrectly permits adoption for issue 30, allowing the multi-issue item's content to be overwritten and its closed status reopened.
    SUMMARY: The PR restricts adoption to intent-bearing single-issue items and reports incidental citations separately. Tests cover the earlier failures, precedence and ambiguity, but omit the trailing-slash bypass reproduced with the head matcher.

Re-review by a read-only codex review agent (gpt-6.1-sol), posted by the orchestrator; back to the author agent.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

Comment thread import-fidelity.ts Fixed

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@unbraind unbraind left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

VERDICT: BLOCK
FINDINGS:

  • [blocking] import-fidelity.ts:78 — Closing Markdown emphasis markers remain inside URL tokens, hiding a second issue reference — Fixes acme/widgets#30 and **https://github.com/acme/widgets/issues/31** incorrectly selects adoption, allowing import to overwrite the multi-issue item's content and status.
    SUMMARY: The PR adopts existing single-issue items while preserving structured ownership precedence and requiring citation intent. The reference matrix and intent/precedence checks pass in isolation, but bold and italic second-URL regressions fail.

Third re-review by a read-only codex review agent (gpt-6.1-sol), posted by the orchestrator; back to the author agent with a fail-safe design change.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@unbraind unbraind left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

VERDICT: BLOCK
FINDINGS:

  • [blocking] import-fidelity.ts:122 — Same-number references to another repository can still permit adoption — Fixes acme/widgets#30 and **https://github.com/other/widgets/issues/30** passes the numeric veto while the strict parser misses the bold URL, allowing import to overwrite a multi-issue item's content and status.
    SUMMARY: The PR reuses existing single-issue items through citation adoption with conservative exclusion and explicit intent checks. Tests cover extensive reference shapes and non-git trackers but omit Markdown-wrapped foreign references sharing the target number.

Fourth re-review by a read-only codex review agent (gpt-6.1-sol), posted by the orchestrator; back to the author agent.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@unbraind unbraind left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

VERDICT: BLOCK
FINDINGS:

  • [blocking] import-fidelity.ts:104 — Encoded second references bypass both parsers: Fixes acme/widgets#30 and [other](https://github.com/other/widgets/issues&sol;31) returns via: "citation" (as does issues%2F31), allowing import to overwrite or reopen a multi-issue item.
    SUMMARY: The PR reuses existing untagged items through conservative citation matching and normal import updates. Tests cover many literal reference decorations but miss encoded references; the Issue: <url> positive control still adopts.

Fifth re-review by a read-only codex review agent (gpt-6.1-sol), posted by the orchestrator. Design decision for the next round: normalize, allowlist anchored forms, and make adoption opt-in.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

Comment thread import-fidelity.ts Fixed
@unbraind unbraind changed the title Reuse single-issue work items during GitHub issue import Require opt-in before adopting cited GitHub issue items Oct 23, 2026

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

Comment thread import-fidelity.ts Fixed
CodeQL flagged the anchored issue-label URL pattern as a polynomial
regular expression: the optional query group and the trailing [.)]*
tail could both match the same characters. The allowed tail (>, then
. or ), then spaces/tabs) is now trimmed by hand before an anchored
pattern without overlapping quantifiers. A test pins the accepted and
refused tails and a 50,000-character hostile input.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

With --adopt-cited, an untagged item whose description said
'Fixes acme/widgets#30' while its github_url named issue 31 was adopted
for #30, overwriting the identity of #31. Items with structured
ownership (a GitHub issue URL in github_url, provenance or external
links, a github_number, provider provenance, or a native 'GitHub issue
<url>' declaration) are now reported as citation candidates with reason
structured_owner and are never adopted from prose.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

…tion

An untagged item whose external_ref was gh:acme/widgets#31 could still
be adopted for #30 from a 'Fixes acme/widgets#30' description. Any
non-empty external_ref (gh:, linear:, jira:, ado: or other providers) now
marks the item as already owned, so prose never re-owns it.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

source_owner (and provider identity fields) were still not treated as
ownership, so an item natively owned by Linear could be adopted and
reopened from a 'Fixes acme/widgets#30' description. The adoption guard
now recognizes every source identity.ts uses: github_* fields,
github_link_only false, external_ref, source_owner, linear_/jira_/ado_
identity fields, provider provenance, native declarations and GitHub
issue URLs in links.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

…adoption guard

The owner matcher accepts a githuburl alias that the adoption guard did
not treat as ownership. Any github-prefixed field (except
github_link_only) now counts as ownership, and the owner-link field
pattern is a single constant used by both checks so they cannot drift.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

…doption

identity.ts recognizes GH:owner/repo#N case-insensitively, while the
adoption filter only parsed lowercase provenance tags, so an item tagged
GH:other/widgets#31 could be adopted for another issue. Any well-formed
GitHub identity tag, in any case, now marks the item as owned.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@unbraind unbraind left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Orchestrator review (built-in Claude review agent, verified by the orchestrator; bots are not waited for since 2026-10-22):

Pre-merge review: eleven read-only codex review rounds (gpt-6.1-sol) plus orchestrator fixes for rounds 6-10.

Rounds 6-10 each found one structured-ownership source that citation adoption did not respect (github_url conflict, core external_ref, source_owner and provider identity fields, the githuburl alias, uppercase GH: tags). The guard now mirrors every ownership source identity.ts and the owner matcher recognize, and both share one owner-link field constant. Each fix has a regression test that fails on revert. CodeQL's polynomial-regex alert on the issue-label URL tail is fixed by linear trimming. Adoption stays opt-in and off by default in the CLI, SDK and reusable workflow.

Final round:
VERDICT: MERGE
FINDINGS:

  • [non-blocking] README.md:988 — The claim that plain imports may write earlier issues before rejecting later ambiguity is stale — all imports now plan the entire batch before writing.
    SUMMARY: The PR requires explicit opt-in for citation adoption and protects existing structured ownership, including mixed-case GitHub identity tags. The reviewed tests cover defaults, ownership guards, normalization, workflow propagation and non-git persistence; I did not execute them.

@unbraind
unbraind merged commit 1fec9f3 into main Oct 23, 2026
11 checks passed
@unbraind
unbraind deleted the feat/cited-issue-adoption branch October 23, 2026 17:16
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