Skip to content

Fix daily AIC accounting for reusable workflows - #74932

Merged
pelikhan merged 5 commits into
mainfrom
copilot/fix-aic-guardrail-counts
Nov 5, 2026
Merged

pelikhan merged 5 commits into
mainfrom
copilot/fix-aic-guardrail-counts

Conversation

Copilot AI commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Daily AIC guardrails counted reusable-workflow runs as zero because caller-prefixed job names did not match billable components, preventing max-daily-ai-credits from triggering.

  • Component matching: Match the final / segment, so caller / agent and outer / caller / agent resolve to agent. Preserve unprefixed names, case normalization, and the Evaluations alias.
  • Regression coverage: Extend accounting cases across unprefixed, caller-prefixed, and nested agent, detection, and evals jobs.

Copilot AI and others added 2 commits November 4, 2026 19:12
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix daily AIC guardrail counts for reusable workflows Fix daily AIC accounting for reusable workflows Nov 4, 2026
Copilot AI requested a review from pelikhan November 4, 2026 19:14
@pelikhan
pelikhan marked this pull request as ready for review November 4, 2026 19:17
Copilot AI adaptive review requested due to automatic review settings November 4, 2026 19:17
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: gpt56 max · ~1 AIC · ⌖ ~1 AIC · ⊞ 6.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · routed: gpt56 max · ~3 AIC · ⌖ ~1 AIC · ⊞ 118 · ◷

Generated by Ponytail Reviewer for #74932

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are blocking the reusable-workflow AI-credit accounting fix.

No open issues 🎉

What changed in this PR

Fixes daily AI-credit accounting for reusable workflows so caller-prefixed job names no longer bypass max-daily-ai-credits guardrails, addressing #74864.

Changes:

  • Matches billable components using the final / segment while preserving case normalization and the Evaluations alias.
  • Extends regression coverage to unprefixed, caller-prefixed, and nested agent, detection, and evals jobs.
File Description
actions/​setup/​js/​daily_aic_component_coverage.test.cjs Adds parameterized coverage for prefixes, nesting, capitalization, and aliases.
actions/​setup/​js/​daily_aic_component_coverage.cjs Extracts the final job-name segment before matching billable components.

Review effort: Balanced (auto)

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-04T19:21:23Z
review_event: COMMENT
top_themes:
  - broad component matching may misclassify unrelated jobs and inflate daily AIC
files_reviewed:
  - actions/setup/js/daily_aic_component_coverage.cjs
  - actions/setup/js/daily_aic_component_coverage.test.cjs
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete: one correctness concern identified about broad component matching.

💡 Findings
  • Final-segment matching can classify unrelated jobs as compiler-owned components and inflate daily AIC.
  • Added regression coverage should include a negative unrelated-suffix case.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

for (const candidate of [job.job_id, job.name]) {
if (typeof candidate !== "string") continue;
const lower = candidate.toLowerCase();
const lower = (candidate.split(" / ").pop() ?? "").toLowerCase();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matching any job whose final segment is agent, detection, or evals can classify unrelated caller jobs as gh-aw components and add their token usage to the daily total, potentially inflating AIC and triggering the guardrail incorrectly.

💡 Restrict component identification or add a negative case

The new logic intentionally supports nested caller prefixes, but it no longer verifies that the prefix/job shape belongs to the compiler-owned reusable workflow. A repository job such as other / detection will now be treated as the detection component. Please constrain the match to the supported generated naming convention (while retaining nested prefixes), or otherwise establish ownership, and add a regression test for an unrelated suffix match.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ab4117f. Prefixed components now require both compiler-generated activation and conclusion siblings under the exact same caller prefix. Unrelated agent/detection/evals suffixes are ignored; regression tests cover miscounts and ambiguity.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd. The fix is correct and the regression tests are meaningful. No blocking issues.

📋 Key Themes & Highlights

Verification

  • Vitest could not run in this sandbox because npm ci failed with a TLS error, so the test suite was not executed through its normal runner. I verified with Node replays of the real modules using mock GitHub clients instead.
  • Replays show caller / Agent, outer / caller / Agent and Build / Agent now resolve to the agent component. caller / agent-helper correctly does not match. Two agent jobs in the same attempt throw Ambiguous daily AIC component jobs, which fails closed.
  • Against the pre-fix code, the prefixed cases return 0. Against the fixed code they return 49.11352, so the new regression cases do catch the bug.

Key Themes

  • Suffix rule scope: matching on the last / segment can make an unrelated job whose name ends in agent, detection or evals a billable component. It fails closed, but it is a new hard-fail mode. See the inline comment on the source line.
  • Test fixture gap: the evaluate helper still matches artifacts by exact job name, so prefixed jobs never exercise real artifact-to-job matching.
  • Test readability: the it.each titles are awkward, and the job() helper gives all prefixed jobs the same id.
  • Missing negative cases: look-alike names and the ambiguity path are not pinned by tests.

Positive Highlights

  • ✅ The source change is a one-line, minimal fix.
  • ✅ Object.hasOwn avoids prototype-key false matches.
  • ✅ The regression cases fail on the old code and pass on the new code.

@copilot please address the review comments above, starting with the test fixture and the negative look-alike case.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again

for (const candidate of [job.job_id, job.name]) {
if (typeof candidate !== "string") continue;
const lower = candidate.toLowerCase();
const lower = (candidate.split(" / ").pop() ?? "").toLowerCase();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] Suffix matching now treats any job whose final / segment is agent, detection or evals as a billable component. A non-compiler job such as security / agent running in the same attempt as the compiler Agent job now throws Ambiguous daily AIC component jobs, so that run accounting fails. Before this change the job was ignored. The failure is fail-closed rather than a miscount, but it is a new hard-fail mode for unrelated job names. Decide whether suffix matching should be limited to the compiler caller-prefix shapes, or document this trade-off and pin it with a test.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ab4117f by checking the compiler caller-group naming convention rather than accepting arbitrary suffixes. security / agent alongside the compiler Agent job is ignored, not ambiguous. Tests also cover nested prefixes, partial/mismatched sibling groups, and siblings on another API page.

"evals/token_usage.jsonl": '{"aic":1}',
},
[job("Agent"), job("Detection"), job("Evaluations")]
names.map(name => job(`${prefix}${name}`))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] The new cases do catch the regression: pre-fix they total 0, post-fix 49.11352. But the evaluate helper (line 42, outside this diff) still matches artifacts by exact lowercased job name, and job() assigns ids by exact name. Every prefixed job therefore gets job id 3 and an undefined artifact id, so attempt greater than 1 producer matching is never exercised with prefixed names. Make the fixture apply the same final / segment rule so artifacts and ids match the real jobs.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ab4117f. Fixture job IDs and producer-artifact matching now normalize the final job-name segment, including the Evaluations alias. The naming matrix runs for attempts 1 and 2, asserts distinct component IDs, and rejects stale prefixed producer artifacts.

["", ["Agent", "Detection", "Evaluations"]],
["caller / ", ["Agent", "Detection", "Evaluations"]],
["outer / caller / ", ["Agent", "Detection", "Evaluations"]],
])("counts %j-prefixed %j jobs using their lowercase accounting paths", async (prefix, names) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] Add a negative case. Nothing pins that look-alikes are ignored, for example caller / agent-helper or caller / my-agent, which should resolve to no component. I confirmed caller / agent-helper is ignored with this change, but a test should lock it in so the suffix rule does not drift to substring or prefix matching. Add it to this it.each, expecting no AIC from that job.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in ab4117f: parameterized negatives for caller / agent-helper, caller / my-agent, and nested look-alikes. Even with compiler sibling jobs present, these contribute zero AIC and require no artifact download.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): Matching any job whose final segment is agent, detection, or evals can classify unrelated caller jobs as gh-aw components. Constrain the match to the supported generated naming convention and add a regression test for an unrelated suffix match. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  3. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): [/codebase-design] A non-compiler job such as security / agent now throws Ambiguous daily AIC component jobs. Decide whether suffix matching should be limited to compiler caller-prefix shapes, or document this trade-off and pin it with a test. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  4. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:209): [/tdd] Make the fixture apply the same final / segment rule so artifacts and ids match the real jobs. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  5. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:202): [/tdd] Add a negative case for look-alikes like caller / agent-helper that should resolve to no component. - Fix daily AIC accounting for reusable workflows #74932 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 42b583d
Sous-chef requested-work: 11e5868a651f029b173b169a7d0c481b88a724bb1c94a6ac179e6b94da3c1159 15a6868825533c8b4e8e551bdd98529fb4ab96898a7eb3e88ebc60642ae28283 4bb098614ee72de44ef8ba62d54c98700e28ecc214854299332abb645a07968c c9da46534082c44860a38473f80ffc2b6f1a1781723ee5fa64e0065b40470635
Sous-chef requested-state: f97e9cdd8346f0de498f8397f0e241174b7703566e1e9df10d1b4c6340b4bcfe

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~13 AIC · ⌖ ~21 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): Matching any job whose final segment is agent, detection, or evals can classify unrelated caller jobs as gh-aw components and add their token usage to the daily total, potentially inflating AIC and triggering the guardrail incorrectly. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  3. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): [/codebase-design] Suffix matching now treats any job whose final / segment is agent, detection or evals as a billable component. A non-compiler job such as security / agent running in the same attempt as the compiler Agent job now throws Ambiguous daily AIC component jobs, so that run accounting fails. Before this change the job was ignored. The failure is fail-closed rather than a miscount, but it is a new hard-fail mode for unrelated job names. Decide whether suffix matching should be limited to the compiler caller-prefix shapes, or document this trade-off and pin it with a test. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  4. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:209): [/tdd] The new cases do catch the regression: pre-fix they total 0, post-fix 49.11352. But the evaluate helper (line 42, outside this diff) still matches artifacts by exact lowercased job name, and job() assigns ids by exact name. Every prefixed job therefore gets job id 3 and an undefined artifact id, so attempt greater than 1 producer matching is never exercised with prefixed names. Make the fixture apply the same final / segment rule so artifacts and ids match the real jobs. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  5. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:202): [/tdd] Add a negative case. Nothing pins that look-alikes are ignored, for example caller / agent-helper or caller / my-agent, which should resolve to no component. I confirmed caller / agent-helper is ignored with this change, but a test should lock it in so the suffix rule does not drift to substring or prefix matching. Add it to this it.each, expecting no AIC from that job. - Fix daily AIC accounting for reusable workflows #74932 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 42b583d
Sous-chef requested-work: 11e5868a651f029b173b169a7d0c481b88a724bb1c94a6ac179e6b94da3c1159 15a6868825533c8b4e8e551bdd98529fb4ab96898a7eb3e88ebc60642ae28283 4bb098614ee72de44ef8ba62d54c98700e28ecc214854299332abb645a07968c c9da46534082c44860a38473f80ffc2b6f1a1781723ee5fa64e0065b40470635
Sous-chef requested-state: f97e9cdd8346f0de498f8397f0e241174b7703566e1e9df10d1b4c6340b4bcfe

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~10 AIC · ⌖ ~14 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): Matching any job whose final segment is agent, detection, or evals can classify unrelated caller jobs as gh-aw components and add their token usage to the daily total, potentially inflating AIC and triggering the guardrail incorrectly. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  3. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): [/codebase-design] Suffix matching now treats any job whose final / segment is agent, detection or evals as a billable component. A non-compiler job such as security / agent running in the same attempt as the compiler Agent job now throws Ambiguous daily AIC component jobs, so that run accounting fails. Before this change the job was ignored. The failure is fail-closed rather than a miscount, but it is a new hard-fail mode for unrelated job names. Decide whether suffix matching should be limited to the compiler caller-prefix shapes, or document this trade-off and pin it with a te... - Fix daily AIC accounting for reusable workflows #74932 (comment)
  4. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:209): [/tdd] The new cases do catch the regression: pre-fix they total 0, post-fix 49.11352. But the evaluate helper (line 42, outside this diff) still matches artifacts by exact lowercased job name, and job() assigns ids by exact name. Every prefixed job therefore gets job id 3 and an undefined artifact id, so attempt greater than 1 producer matching is never exercised with prefixed names. Make the fixture apply the same final / segment rule so artifacts and ids match the real jobs. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  5. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:202): [/tdd] Add a negative case. Nothing pins that look-alikes are ignored, for example caller / agent-helper or caller / my-agent, which should resolve to no component. I confirmed caller / agent-helper is ignored with this change, but a test should lock it in so the suffix rule does not drift to substring or prefix matching. Add it to this it.each, expecting no AIC from that job. - Fix daily AIC accounting for reusable workflows #74932 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 42b583d
Sous-chef requested-work: 11e5868a651f029b173b169a7d0c481b88a724bb1c94a6ac179e6b94da3c1159 15a6868825533c8b4e8e551bdd98529fb4ab96898a7eb3e88ebc60642ae28283 4bb098614ee72de44ef8ba62d54c98700e28ecc214854299332abb645a07968c c9da46534082c44860a38473f80ffc2b6f1a1781723ee5fa64e0065b40470635
Sous-chef requested-state: f97e9cdd8346f0de498f8397f0e241174b7703566e1e9df10d1b4c6340b4bcfe

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~9 AIC · ⌖ ~8 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): Matching any job whose final segment is agent, detection, or evals can classify unrelated caller jobs as gh-aw components and add their token usage to the daily total, potentially inflating AIC and triggering the guardrail incorrectly. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  3. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): [/codebase-design] Suffix matching now treats any job whose final / segment is agent, detection or evals as a billable component. A non-compiler job such as security / agent running in the same attempt as the compiler Agent job now throws Ambiguous daily AIC component jobs, so that run accounting fails. Before this change the job was ignored. The failure is fail-closed rather than a miscount, but it is a new hard-fail mode for unrelated job names. Decide whether suffix matching should be limited to the compiler caller-prefix shapes, or document this trade-off and pin it with a test. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  4. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:209): [/tdd] The new cases do catch the regression: pre-fix they total 0, post-fix 49.11352. But the evaluate helper (line 42, outside this diff) still matches artifacts by exact lowercased job name, and job() assigns ids by exact name. Every prefixed job therefore gets job id 3 and an undefined artifact id, so attempt greater than 1 producer matching is never exercised with prefixed names. Make the fixture apply the same final / segment rule so artifacts and ids match the real jobs. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  5. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:202): [/tdd] Add a negative case. Nothing pins that look-alikes are ignored, for example caller / agent-helper or caller / my-agent, which should resolve to no component. I confirmed caller / agent-helper is ignored with this change, but a test should lock it in so the suffix rule does not drift to substring or prefix matching. Add it to this it.each, expecting no AIC from that job. - Fix daily AIC accounting for reusable workflows #74932 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 42b583d
Sous-chef requested-work: 11e5868a651f029b173b169a7d0c481b88a724bb1c94a6ac179e6b94da3c1159 15a6868825533c8b4e8e551bdd98529fb4ab96898a7eb3e88ebc60642ae28283 4bb098614ee72de44ef8ba62d54c98700e28ecc214854299332abb645a07968c c9da46534082c44860a38473f80ffc2b6f1a1781723ee5fa64e0065b40470635
Sous-chef requested-state: f97e9cdd8346f0de498f8397f0e241174b7703566e1e9df10d1b4c6340b4bcfe

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~16 AIC · ⌖ ~13 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): Matching any job whose final segment is agent, detection, or evals can classify unrelated caller jobs as gh-aw components and add their token usage to the daily total, potentially inflating AIC and triggering the guardrail incorrectly. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  3. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): [/codebase-design] Suffix matching now treats any job whose final / segment is agent, detection or evals as a billable component. A non-compiler job such as security / agent running in the same attempt as the compiler Agent job now throws Ambiguous daily AIC component jobs, so that run accounting fails. Before this change the job was ignored. The failure is fail-closed rather than a miscount, but it is a new hard-fail mode for unrelated job names. Decide whether suffix matching should be limited to the compiler caller-prefix shapes, or document this trade-off and pin it with a test. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  4. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:209): [/tdd] The new cases do catch the regression: pre-fix they total 0, post-fix 49.11352. But the evaluate helper (line 42, outside this diff) still matches artifacts by exact lowercased job name, and job() assigns ids by exact name. Every prefixed job therefore gets job id 3 and an undefined artifact id, so attempt greater than 1 producer matching is never exercised with prefixed names. Make the fixture apply the same final / segment rule so artifacts and ids match the real jobs. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  5. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:202): [/tdd] Add a negative case. Nothing pins that look-alikes are ignored, for example caller / agent-helper or caller / my-agent, which should resolve to no component. I confirmed caller / agent-helper is ignored with this change, but a test should lock it in so the suffix rule does not drift to substring or prefix matching. Add it to this it.each, expecting no AIC from that job. - Fix daily AIC accounting for reusable workflows #74932 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 42b583d
Sous-chef requested-work: 11e5868a651f029b173b169a7d0c481b88a724bb1c94a6ac179e6b94da3c1159 15a6868825533c8b4e8e551bdd98529fb4ab96898a7eb3e88ebc60642ae28283 4bb098614ee72de44ef8ba62d54c98700e28ecc214854299332abb645a07968c c9da46534082c44860a38473f80ffc2b6f1a1781723ee5fa64e0065b40470635
Sous-chef requested-state: f97e9cdd8346f0de498f8397f0e241174b7703566e1e9df10d1b4c6340b4bcfe

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~12 AIC · ⌖ ~16 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): Matching any job whose final segment is agent, detection, or evals can classify unrelated caller jobs as gh-aw components and add their token usage to the daily total, potentially inflating AIC and triggering the guardrail incorrectly. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  3. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): [/codebase-design] Suffix matching now treats any job whose final / segment is agent, detection or evals as a billable component. A non-compiler job such as security / agent running in the same attempt as the compiler Agent job now throws Ambiguous daily AIC component jobs, so that run accounting fails. Before this change the job was ignored. The failure is fail-closed rather than a miscount, but it is a new hard-fail mode for unrelated job names. Decide whether suffix matching should be limited to the compiler caller-prefix shapes, or document this trade-off and pin it with a test. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  4. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:209): [/tdd] The new cases do catch the regression: pre-fix they total 0, post-fix 49.11352. But the evaluate helper (line 42, outside this diff) still matches artifacts by exact lowercased job name, and job() assigns ids by exact name. Every prefixed job therefore gets job id 3 and an undefined artifact id, so attempt greater than 1 producer matching is never exercised with prefixed names. Make the fixture apply the same final / segment rule so artifacts and ids match the real jobs. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  5. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:202): [/tdd] Add a negative case. Nothing pins that look-alikes are ignored, for example caller / agent-helper or caller / my-agent, which should resolve to no component. I confirmed caller / agent-helper is ignored with this change, but a test should lock it in so the suffix rule does not drift to substring or prefix matching. Add it to this it.each, expecting no AIC from that job. - Fix daily AIC accounting for reusable workflows #74932 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 42b583d
Sous-chef requested-work: 11e5868a651f029b173b169a7d0c481b88a724bb1c94a6ac179e6b94da3c1159 15a6868825533c8b4e8e551bdd98529fb4ab96898a7eb3e88ebc60642ae28283 4bb098614ee72de44ef8ba62d54c98700e28ecc214854299332abb645a07968c c9da46534082c44860a38473f80ffc2b6f1a1781723ee5fa64e0065b40470635
Sous-chef requested-state: f97e9cdd8346f0de498f8397f0e241174b7703566e1e9df10d1b4c6340b4bcfe

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~19 AIC · ⌖ ~14 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): Matching any job whose final segment is agent, detection, or evals can classify unrelated caller jobs as gh-aw components and add their token usage to the daily total, potentially inflating AIC and triggering the guardrail incorrectly. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  3. Review (actions/setup/js/daily_aic_component_coverage.cjs:24): [/codebase-design] Suffix matching now treats any job whose final / segment is agent, detection or evals as a billable component. A non-compiler job such as security / agent running in the same attempt as the compiler Agent job now throws Ambiguous daily AIC component jobs, so that run accounting fails. Before this change the job was ignored. The failure is fail-closed rather than a miscount, but it is a new hard-fail mode for unrelated job names. Decide whether suffix matching should be limited to the compiler caller-prefix shapes, or document this trade-off and pin it with a te... - Fix daily AIC accounting for reusable workflows #74932 (comment)
  4. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:209): [/tdd] The new cases do catch the regression: pre-fix they total 0, post-fix 49.11352. But the evaluate helper (line 42, outside this diff) still matches artifacts by exact lowercased job name, and job() assigns ids by exact name. Every prefixed job therefore gets job id 3 and an undefined artifact id, so attempt greater than 1 producer matching is never exercised with prefixed names. Make the fixture apply the same final / segment rule so artifacts and ids match the real jobs. - Fix daily AIC accounting for reusable workflows #74932 (comment)
  5. Review (actions/setup/js/daily_aic_component_coverage.test.cjs:202): [/tdd] Add a negative case. Nothing pins that look-alikes are ignored, for example caller / agent-helper or caller / my-agent, which should resolve to no component. I confirmed caller / agent-helper is ignored with this change, but a test should lock it in so the suffix rule does not drift to substring or prefix matching. Add it to this it.each, expecting no AIC from that job. - Fix daily AIC accounting for reusable workflows #74932 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 42b583d
Sous-chef requested-work: 11e5868a651f029b173b169a7d0c481b88a724bb1c94a6ac179e6b94da3c1159 15a6868825533c8b4e8e551bdd98529fb4ab96898a7eb3e88ebc60642ae28283 4bb098614ee72de44ef8ba62d54c98700e28ecc214854299332abb645a07968c c9da46534082c44860a38473f80ffc2b6f1a1781723ee5fa64e0065b40470635
Sous-chef requested-state: f97e9cdd8346f0de498f8397f0e241174b7703566e1e9df10d1b4c6340b4bcfe

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~14 AIC · ⌖ ~8 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@pelikhan

pelikhan commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Copilot AI and others added 2 commits November 4, 2026 22:40
…rail-counts

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

pelikhan commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot compiler threat specification or safe output spec - where daily aic is specified

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Ran pr-finisher. Merged main via make merge-main (732ef66), pushed the accounting/fixture fixes (ab4117f), and replied to all four review threads. Formatting, full lint, TypeScript, 263 focused tests, and the final impacted-test gate pass; secrets scan is clean. CodeQL timed out. Thread resolution is unavailable with the authenticated tools here, so those threads still need resolving. GitHub reports the PR blocked; CI on the new HEAD remains unverified and needs a maintainer re-trigger. No merge or CI dispatch performed.

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot compiler threat specification or safe output spec - where daily aic is specified

Neither—the normative home is AI Credits Specification §9, Daily AI Credits Guardrail.

Specifically, §9.11, Per-Run Accounting and Source Fallbacks specifies component-name normalization, ambiguous-job rejection, rerun selection, and producer-artifact coverage. That is the appropriate section for this PR’s reusable caller-prefix/ownership contract; it currently does not spell out that naming rule.

Local location: /home/runner/work/gh-aw/gh-aw/docs/src/content/docs/specs/ai-credits-specification.md:523.

@pelikhan
pelikhan merged commit 3e8a909 into main Nov 5, 2026
56 checks passed
@pelikhan
pelikhan deleted the copilot/fix-aic-guardrail-counts branch November 5, 2026 05:37
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.1

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.

Daily AIC guardrail counts every run of a reusable workflow as 0 AIC

4 participants