[NO-TICKET] Save the claim link and recognise a claimed site in scan, status and guide - #346
Merged
Merged
Conversation
…guide The link that connects a site to a Patchstack account was only printed, so a tool that hides command output lost it. And nothing told scan or guide that the site had been claimed in the browser, so both kept asking for a claim that had already happened. - scan saves the claim link to .patchstackrc.json when it creates the site. - scan, status and claim learn whether the site has an owner from the claim page's public preview, and record "claimed": true once it does. The link is dropped at that point. scan stops asking once the file says claimed. - guide still sends nothing; it reads that note. - AGENT-INSTALL.md and README.md describe the new request and fields. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Adds claim tracking with clear state persistence and comprehensive tests. 🎯 Quality: 87% Excellent · 📦 Size: Large — consider splitting if possible 🤖 Authorship: Agent-written — Claude Code, going by its own attribution. Whether a person read it is unknown; coding agents can call the 📈 This month: Your 205th PR — above team average · Averaging Good |
Contributor
Author
|
/review |
patchstackdave
approved these changes
Oct 2, 2026
…nd-claimed-state # Conflicts: # AGENT-INSTALL.md # tests/config.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
scansaves the link that connects the site to a Patchstack account in.patchstackrc.json(claimUrl) when it creates the site, so the link is not lost with the terminal output.scan,statusandclaimnow learn whether the site has an owner.scanandstatusask the claim page's public preview (GET monitor/claim/preview?site=<uuid>);claimalready knows when it finishes. When the site has an owner, they write"claimed": trueto.patchstackrc.jsonand dropclaimUrl.scanstops asking once the file saysclaimed, so a build does not make the request on every run.guidestill sends nothing over the network. It marks "Connect project to Patchstack account" done from that note.statusprints aConnected:line (yes / not yet / could not be verified) instead of always saying "Not connected yet?".Why
The claim link was only printed. A tool that hides command output had no way to show it, and an agent that missed it had nowhere to look it up. And when someone claimed the site in the browser, nothing told the CLI, so
scanandguidekept saying "connect this project to your Patchstack account" after it was done.How it behaves
scanguideclaimUrl; asks once; not connectedclaimed: true, ✔ connectedclaimedclaimed: truewithout askingThe lookup sends no credential and nothing about the project; the site UUID is the whole request.
AGENT-INSTALL.mdlists it with the other endpoints, and the command table now shows whatscan,statusandclaimwrite.Verified
npm test: 4154 passed, 7 skipped. That includes new tests for the lookup, the config writer,guidereading the note, and a packaged-bin test where a scan sees an owner, writes the note, and doesn't ask on the next run.npm run typecheck,npm run build,npm run capabilities:check.statusagainst a local fake server for both states, and checked the.patchstackrc.jsonit left each time.Outstanding
This changes
guideoutput andAGENT-INSTALL.md, so the hostile field test (node field-test/run.mjs --persona hostile --rounds 3, plusstandardfor doc accuracy) needs to run right after the release that carries it.🤖 Generated with Claude Code