-
Notifications
You must be signed in to change notification settings - Fork 0
drive: cloud run 7887ca34 #42
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,9 +15,11 @@ | |
|
|
||
| /** First bold top-level bullet: `- **Title** rest`. */ | ||
| const ENTRY = /^- \*\*(.+?)\*\*\s*(.*(?:\n .*)*)/m; | ||
| const ACTION_TITLE = | ||
| /^(?:add|build|change|close|create|document|fix|implement|persist|refuse|release|remove|rename|replace|sharpen|update|validate|wire)\b/i; | ||
| const NOTES_TITLE = /^(?:notes?|release notes|upstream issues)\s*(?:\(|:|$)/i; | ||
| const CODE_REFERENCE = /`([^`]+)`/g; | ||
| // Outcomes include explicit changes and concrete defect statements. A list of | ||
| // identifiers or links alone carries neither, so it cannot qualify as work. | ||
| const ENGINEERING_OUTCOME = | ||
| /\b(?:add|asserts?|breaks?|build|cannot|capture|catches?|change|close|collapses?|cross-compile|delete|document|drift|duplicates?|fails?|fix|implement|invoke|leaks?|make|missing|must|needs?|no (?:end-to-end )?coverage|persist|refuse|register|replace|reserve|restore|run|scope|should|spawn|untested|update|use|validate|verified?|wire|wrong)\b/i; | ||
|
|
||
| export interface BacklogEntry { | ||
| title: string; | ||
|
|
@@ -108,18 +110,27 @@ function isNonEmptyStringArray(value: unknown): value is string[] { | |
| */ | ||
| export function packageFromEntry(entry: BacklogEntry): Record<string, unknown> { | ||
| const blob = `${entry.title} ${entry.body}`; | ||
| const files = scopeReferences(blob); | ||
| const references = [...entry.body.matchAll(CODE_REFERENCE)].map((match) => match[1] ?? ''); | ||
| const files = [ | ||
| ...new Set( | ||
| references | ||
| .filter( | ||
| (candidate): candidate is string => | ||
| /^[A-Za-z_][A-Za-z0-9._-]*(?:\/[A-Za-z0-9._-]*)+$/.test(candidate) && | ||
| !/^\/|\/\//.test(candidate), | ||
| ), | ||
| ), | ||
| ]; | ||
| const hasEngineeringOutcome = ENGINEERING_OUTCOME.test(entry.body); | ||
| // A symbol or command locates work in this repository, but not necessarily | ||
| // one file. Preserve that honest breadth instead of discarding the signal. | ||
| if (files.length === 0 && references.length > 0 && hasEngineeringOutcome) { | ||
| files.push('.'); | ||
|
Comment on lines
+127
to
+128
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an entry contains only a stale, misspelled, or non-path backticked reference and any outcome keyword—for example, AGENTS.md reference: AGENTS.md:L16-L18 Useful? React with 👍 / 👎. |
||
| } | ||
| const gate = blob.match(/\bgate[ -]?(\d+)\b/i); | ||
| const explicitChecks = (entry.body.match(/`[^`]+`/g) || []) | ||
| .map((candidate) => candidate.slice(1, -1)) | ||
| .filter((candidate) => /\s/.test(candidate)); | ||
| const definitionOfDone = NOTES_TITLE.test(entry.title) | ||
| ? [] | ||
| : explicitChecks.length > 0 | ||
| ? explicitChecks | ||
| : ACTION_TITLE.test(entry.title) | ||
| ? [entry.title.replace(/[.:]\s*$/, '')] | ||
| : []; | ||
| const definitionOfDone = hasEngineeringOutcome | ||
| ? [entry.title.replace(/[.:]\s*$/, '')] | ||
| : []; | ||
|
Comment on lines
+131
to
+133
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an actionable body includes a concrete check, such as AGENTS.md reference: AGENTS.md:L16-L18 Useful? React with 👍 / 👎. |
||
| return { | ||
| title: entry.title, | ||
| description: entry.body, | ||
|
|
@@ -128,15 +139,3 @@ export function packageFromEntry(entry: BacklogEntry): Record<string, unknown> { | |
| definition_of_done: definitionOfDone, | ||
| }; | ||
| } | ||
|
|
||
| /** Backticked paths, symbols, and command references are explicit scope. */ | ||
| function scopeReferences(blob: string): string[] { | ||
| const references = [...blob.matchAll(/`([^`]+)`/g)] | ||
| .map((match) => match[1]) | ||
| .filter((candidate): candidate is string => candidate !== undefined) | ||
| .filter((candidate) => { | ||
| if (/^\/|\/\//.test(candidate)) return false; | ||
| return !/\s/.test(candidate) || /--|<[^>]+>|\$[A-Za-z]/.test(candidate); | ||
| }); | ||
| return [...new Set(references)]; | ||
| } | ||
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.
For entries whose concrete path appears in the bold title, scanning only
entry.bodydrops that scope even though the previous matcher scanned the combined title and body. The real backlog entry titled ``sdk/node_modulesis absent, for example, now loses `sdk/node_modules` and falls back to `.` because its body contains only command/symbol references, broadening the package from the named target to the entire repository.Useful? React with 👍 / 👎.