Skip to content

feat(artifact-delivery): flag a run command that keeps failing - #490

Merged
harlan-zw merged 2 commits into
mainfrom
feat/run-check-flag
Oct 6, 2026
Merged

harlan-zw merged 2 commits into
mainfrom
feat/run-check-flag

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Related to #481

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The sweep-skill-runs task from #481 records how each Skill's run check settles. A visitor could still copy a run command that failed every check, and the homepage could feature that Skill.

Now two checks in a row that fail for a reason a retry cannot change flag the Skill. One passing check clears the flag. A retryable failure, such as RATE_LIMITED or SERVICE_UNAVAILABLE, never counts toward a flag and never clears one.

  • Skill page: the run command stays. A quiet note under it gives the reason in plain words, the date of the last failing check, and a link to the SKILL.md on GitHub. It renders on the server, in both command panel layouts. The icon is the only colour; there is no red fill.
  • Curated surfaces: /api/skill-demos (homepage demos and /skills/demos), /api/feed/trending (homepage board and /skills/trending) and the collection page route leave a flagged Skill out. A collection's Repository entries stay.
  • Route: the new internal GET /api/run-checks/flags in artifact delivery returns every flag, or one Skill's with ?skill=owner/repository/name. It uses defineApiHandler with a schema, handler and presenter. It has no policy, because it is a public read of facts the Skill page shows. Other layers read it over HTTP. If that read fails, the surface logs run-check-flags-read and shows every Skill.
  • Rule: nextRunCheckState and runCheckFlag in run-check-state.ts hold it. The sweep stores the state they return, and the route applies the same runCheckFlag.
  • Migration: 0143 adds failure_streak, failed_at and an index on the streak, so the route reads only flagged rows. It counts each row's current failure once. On 7 Oct 2026, 3 production rows had failed this way: garrytan/gstack/gstack, hugohe3/ppt-master/ppt-master and clerk/skills/clerk-orgs. Each flags only after one more failing check.

#483 merged while this branch was open. Its rule, where a retryable failure keeps a known failure, now lives in nextRunCheckState, and its test is unchanged.

These surfaces still show a flagged Skill: track pages, the all time range of /skills/trending, /api/collections/featured, the weekly email, and the collection install manifest. Because of the manifest, a collection install still includes a flagged Skill, while the page counts only the Skills it lists.

Proposed term. GLOSSARY.md has no name for the scheduled check, so this PR uses run check: one Resolution request the sweep sends for an indexed Skill's run command, and how it ended. The run check flag is the state after two failures in a row. The UI says "Run failed in the last two checks" and "Last checked 6 Oct 2026". "Check" also names a check result on one Artifact, so the entry should record that collision. GLOSSARY.md stays unchanged until the term is approved.

Architecture: the sweep writes the failure streak, artifact delivery answers GET /api/run-checks/flags, and the Skill page and the demo, trending and collection routes read it over HTTP

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

The sweep from #481 records how each Skill's run check settles, but a
visitor still saw a run command that fails every time. Two checks in a
row that fail for a reason a retry cannot change now flag the run
command on the Skill page, and the curated surfaces leave the Skill out
until one check passes. A retryable failure never counts.
A failed or mocked fetch leaves the data null, so the page must not
assume the default answer.
@harlan-zw

Copy link
Copy Markdown
Collaborator Author

Agent check, by hand, since CI cannot cover it. A local build served by wrangler dev, with Skill page data from production and a local artifact_run_checks row for garrytan/gstack/gstack. Its reason is the production one; the second failure was seeded locally.

Desktop rail, light Desktop rail, dark Phone, 390px
Desktop rail, light: the flag under the Copy prompt button Desktop rail, dark Phone: the flag under the run prompt in the Run tab
  • The server HTML holds the flag in both command panel layouts. A Skill with one failing check shows none.
  • With emilkowalski/skills/animate flagged, /api/skill-demos returned 12 of 13 demos.
  • With a flagged Skill in harlan-zw/design-engineering-essentials, the collection route listed 8 of 9. Removing the row restored 9.
  • With a flagged fallback Skill, /api/feed/trending dropped it from the board.
  • ?skill=bad answers 400. The phone page has no horizontal scroll.

@harlan-zw harlan-zw added the harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. label Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. labels Oct 6, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-06 16:11 UTC.

GitHub merged this pull request.

No material findings were recorded.

The pull request closed.

@harlan-zw harlan-zw added the harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. label Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026
@harlan-zw
harlan-zw merged commit 00cb19d into main Oct 6, 2026
3 of 7 checks passed
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.

1 participant