-
Notifications
You must be signed in to change notification settings - Fork 0
Authority upgrades: diffs, badge/cert, fix-it snippets #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9a0f3e6
feat(shared): diff algorithm + types + tests
khalidsaidi a81af40
feat(api): store diffs and extend latest response
khalidsaidi b8f4a7a
feat(api): add badge svg endpoint
khalidsaidi 69c7e1f
feat(web): authority homepage proof box
khalidsaidi b7faf4e
feat(web): report diffs, fix-it snippets, certificate
khalidsaidi ea6ce64
docs: update spec, openapi, and versioning
khalidsaidi f337a5a
ci: add live smoke checks
khalidsaidi d4d7d96
chore: update lockfile
khalidsaidi 08a8675
chore: refresh build artifacts
khalidsaidi 2bea0a6
chore: refresh build outputs
khalidsaidi 31ef73d
feat(brand): add authority kit assets and embeds
khalidsaidi 2627756
chore: refresh build artifacts
khalidsaidi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Decisions | ||
|
|
||
| - Implemented report diffs, badge/cert, fix-it snippets; bumped spec_version to 1.2; added /badge/{domain}.svg. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| export type BadgeInput = { | ||
| domain: string; | ||
| score?: number | null; | ||
| grade?: string | null; | ||
| updatedAtISO?: string | null; | ||
| statusLabel?: string | null; | ||
| }; | ||
|
|
||
| function escapeXml(value: string): string { | ||
| return value.replace(/[<>&'"]/g, (char) => { | ||
| switch (char) { | ||
| case "<": | ||
| return "<"; | ||
| case ">": | ||
| return ">"; | ||
| case "&": | ||
| return "&"; | ||
| case "\"": | ||
| return """; | ||
| case "'": | ||
| return "'"; | ||
| default: | ||
| return char; | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| export function renderBadgeSvg({ | ||
| domain, | ||
| score, | ||
| grade, | ||
| updatedAtISO, | ||
| statusLabel, | ||
| }: BadgeInput): string { | ||
| const left = "Agentability"; | ||
| const right = | ||
| statusLabel ?? (score == null ? "Not evaluated" : `Score ${score}${grade ? ` (${grade})` : ""}`); | ||
| const date = updatedAtISO ? updatedAtISO.slice(0, 10) : ""; | ||
| const sub = date ? `updated ${date}` : ""; | ||
|
|
||
| return `<?xml version="1.0" encoding="UTF-8"?> | ||
| <svg xmlns="http://www.w3.org/2000/svg" width="420" height="28" viewBox="0 0 420 28" role="img" aria-label="${escapeXml(left)}: ${escapeXml(right)}"> | ||
| <rect x="0" y="0" width="420" height="28" rx="6" fill="#0b0f19"/> | ||
| <rect x="0" y="0" width="160" height="28" rx="6" fill="#111827"/> | ||
| <rect x="156" y="0" width="264" height="28" rx="6" fill="#0b0f19"/> | ||
|
|
||
| <g transform="translate(10,5)" fill="none" stroke="#e5e7eb" stroke-width="1.8" stroke-linejoin="round"> | ||
| <path d="M10 0l8 4v6c0 5-3 9-8 12C5 19 2 15 2 10V4l8-4z"/> | ||
| <path d="M5.2 10.5l2.2 2.2 6-6.2" stroke-linecap="round"/> | ||
| </g> | ||
|
|
||
| <text x="40" y="18" font-family="ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial" | ||
| font-size="12" fill="#e5e7eb" font-weight="700" letter-spacing=".2">${escapeXml(left)}</text> | ||
|
|
||
| <text x="170" y="18" font-family="ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial" | ||
| font-size="12" fill="#e5e7eb" font-weight="600">${escapeXml(right)}</text> | ||
|
|
||
| ${sub ? `<text x="410" y="18" text-anchor="end" | ||
| font-family="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace" | ||
| font-size="10" fill="#9ca3af">${escapeXml(sub)}</text>` : ""} | ||
|
|
||
| <title>${escapeXml(domain)}</title> | ||
| </svg>`; | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| export const SSR_ASSETS = { | ||
| "scriptSrc": "/assets/index-BwWXd1jY.js", | ||
| "cssHref": "/assets/index-DXsQJ1HL.css" | ||
| "scriptSrc": "/assets/index-BTJpqCVz.js", | ||
| "cssHref": "/assets/index-EQLOK5sA.css" | ||
| } as const; |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
previousRunIdis captured once at evaluation start, before the run completes. If two evaluations for the same domain overlap, the later-finishing run will still compare against the run that was latest at start, not the run that actually completed most recently. That meansdiffSummary/previousSummarycan be wrong for concurrent runs. Consider re-readinglatestRunId(or using a transaction) right before finalizing the run to ensure the diff is based on the immediate predecessor.Useful? React with 👍 / 👎.