Skip to content

[NO-TICKET] Save the claim link and recognise a claimed site in scan, status and guide - #346

Merged
daniloradovic merged 2 commits into
mainfrom
fix/save-claim-link-and-claimed-state
Oct 2, 2026
Merged

daniloradovic merged 2 commits into
mainfrom
fix/save-claim-link-and-claimed-state

Conversation

@daniloradovic

Copy link
Copy Markdown
Contributor

What changed

  • scan saves 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, status and claim now learn whether the site has an owner. scan and status ask the claim page's public preview (GET monitor/claim/preview?site=<uuid>); claim already knows when it finishes. When the site has an owner, they write "claimed": true to .patchstackrc.json and drop claimUrl.
  • scan stops asking once the file says claimed, so a build does not make the request on every run.
  • guide still sends nothing over the network. It marks "Connect project to Patchstack account" done from that note.
  • status prints a Connected: 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 scan and guide kept saying "connect this project to your Patchstack account" after it was done.

How it behaves

Situation scan guide
Site just created Saves claimUrl; asks once; not connected Not connected, shows the link
Claimed in the browser Asks, sees an owner, writes claimed: true, ✔ connected ✔ connected
File already says claimed Does not ask; ✔ connected ✔ connected
Claim token connected it Writes claimed: true without asking ✔ connected
Lookup fails or times out Not connected, file untouched; never fails the scan Unchanged

The lookup sends no credential and nothing about the project; the site UUID is the whole request. AGENT-INSTALL.md lists it with the other endpoints, and the command table now shows what scan, status and claim write.

Verified

  • npm test: 4154 passed, 7 skipped. That includes new tests for the lookup, the config writer, guide reading 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.
  • Ran the built CLI's status against a local fake server for both states, and checked the .patchstackrc.json it left each time.

Outstanding

This changes guide output and AGENT-INSTALL.md, so the hostile field test (node field-test/run.mjs --persona hostile --rounds 3, plus standard for doc accuracy) needs to run right after the release that carries it.

🤖 Generated with Claude Code

…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>
@coderbuds

coderbuds Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

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 report-ai-usage tool to say.

📈 This month: Your 205th PR — above team average · Averaging Good

See how your team is trending →

@daniloradovic

Copy link
Copy Markdown
Contributor Author

/review

…nd-claimed-state

# Conflicts:
#	AGENT-INSTALL.md
#	tests/config.test.ts
@daniloradovic
daniloradovic merged commit 4208769 into main Oct 2, 2026
23 checks passed
@daniloradovic
daniloradovic deleted the fix/save-claim-link-and-claimed-state branch October 2, 2026 11:22
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