mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 09:26:52 +01:00
Merge pull request #20 from microsoft/jesperschulz/strengthen-al-code-review
Strengthen al-code-review execution; propagate suggested-code to leaves
This commit is contained in:
commit
832504d428
7 changed files with 28 additions and 3 deletions
|
|
@ -60,9 +60,18 @@ The worklist is the list of sub-skills judged relevant by the previous step. Eve
|
||||||
|
|
||||||
## Action
|
## Action
|
||||||
|
|
||||||
|
### Execution discipline (mandatory)
|
||||||
|
|
||||||
|
The Action step is a sequence of **discrete iterations**, not one combined generation. The contract requires the super-skill to invoke each sub-skill in turn and then perform a self-review pass. Concretely this means:
|
||||||
|
|
||||||
|
- Treat each sub-skill in the worklist as its own pass: read the sub-skill's instructions, apply its Source → Relevance → Worklist → Action steps to the orchestrator-supplied inputs, and produce that sub-skill's complete findings-report before moving on.
|
||||||
|
- Do not collapse multiple sub-skills into one shared reasoning step. Each sub-skill has a distinct knowledge subset and a distinct evaluation procedure; sharing one rolled-up scan dilutes per-skill attention and causes leaves to silently underreport (this has been observed in production: leaf skills returned empty `findings[]` while their standalone runs against the same diff produced multiple matches).
|
||||||
|
- The agent self-review pass is its own final iteration. Begin it only after every sub-skill in the worklist has completed and its sub-result is recorded.
|
||||||
|
- Sub-skills are independent: re-walking the diff once per sub-skill is correct and expected. The output schema accommodates this — `sub-results` carries one entry per sub-skill, each a complete findings-report.
|
||||||
|
|
||||||
### Roll up sub-skill findings
|
### Roll up sub-skill findings
|
||||||
|
|
||||||
For each sub-skill in the worklist:
|
For each sub-skill in the worklist, executed one at a time per the discipline above:
|
||||||
|
|
||||||
1. Invoke the sub-skill with the orchestrator's inputs, passing only the subset each sub-skill declares in its `inputs`.
|
1. Invoke the sub-skill with the orchestrator's inputs, passing only the subset each sub-skill declares in its `inputs`.
|
||||||
2. Capture the sub-skill's complete findings-report verbatim and append it to `sub-results`.
|
2. Capture the sub-skill's complete findings-report verbatim and append it to `sub-results`.
|
||||||
|
|
@ -71,7 +80,11 @@ For each sub-skill in the worklist:
|
||||||
|
|
||||||
### Agent self-review pass
|
### Agent self-review pass
|
||||||
|
|
||||||
After the sub-skill rollup, perform a self-review pass against the same task input using the agent's built-in BC and AL knowledge. BCQuality is an **additive** knowledge layer: it augments the agent's review judgement, it does not replace it. The goal of this pass is to surface defects the agent recognises on its own — bugs, anti-patterns, error-handling gaps, AL idioms — that the leaf sub-skills did not catch because no BCQuality knowledge file covers them yet.
|
After every sub-skill has produced its sub-result, perform a self-review pass against the same task input using the agent's built-in BC and AL knowledge. BCQuality is an **additive** knowledge layer: it augments the agent's review judgement, it does not replace it. The goal of this pass is to surface defects the agent recognises on its own — bugs, anti-patterns, error-handling gaps, AL idioms — that the leaf sub-skills did not catch because no BCQuality knowledge file covers them yet.
|
||||||
|
|
||||||
|
This pass is mandatory. An empty agent-findings list is acceptable only when the diff is small enough that the leaves have provably exhausted the surface (in practice: PRs of ≤2 files with ≤30 changed lines and at least one sub-skill emitting findings). For larger diffs, returning an empty agent-findings list is a defect — the agent has built-in BC/AL knowledge that the leaves cannot supply, and refusing to apply it is the most common cause of parity loss against agents that do not have a BCQuality layer at all.
|
||||||
|
|
||||||
|
Frame the pass by the domains the sub-skills already cover (performance, security, privacy, style, upgrade, UI) and by the cross-cutting concerns that span them (architecture, error handling, resource lifecycle). For each domain, ask whether the diff exhibits a pattern the agent recognises as a defect from general AL knowledge and that the corresponding sub-skill did not flag. The categories are anchors for completeness, not a script: a candidate from any category is in scope, and a candidate from no category is also in scope when the agent has independent grounds for it.
|
||||||
|
|
||||||
For every candidate the agent identifies in this pass:
|
For every candidate the agent identifies in this pass:
|
||||||
|
|
||||||
|
|
@ -85,7 +98,7 @@ For every candidate the agent identifies in this pass:
|
||||||
- `id` is a skill-defined slug prefixed with `agent:` (for example, `agent:missing-error-handling-on-http-call`).
|
- `id` is a skill-defined slug prefixed with `agent:` (for example, `agent:missing-error-handling-on-http-call`).
|
||||||
- `confidence` capped at `medium`.
|
- `confidence` capped at `medium`.
|
||||||
- `message` is non-empty and self-contained, describing both the issue and a concrete recommendation. A consumer rendering the finding has no knowledge-file footer to fall back on.
|
- `message` is non-empty and self-contained, describing both the issue and a concrete recommendation. A consumer rendering the finding has no knowledge-file footer to fall back on.
|
||||||
- `suggested-code` SHOULD be set when the fix is small and mechanical (e.g. removing a few unreachable lines, replacing a `Count() > 0` test with `not IsEmpty()`, declaring a missing `Label`). Omit it when the appropriate fix depends on context the agent cannot determine.
|
- `suggested-code` SHOULD be set when the fix is small and mechanical (e.g. removing a few unreachable lines, replacing a `Count() > 0` test with `not IsEmpty()`, declaring a missing `Label`, adding an `else` branch to a `case` over an enum). Omit it when the appropriate fix depends on context the agent cannot determine.
|
||||||
|
|
||||||
Leaf sub-skills MUST NOT emit agent findings: their scope is bounded by the knowledge subset they evaluate. The self-review pass is a super-skill responsibility.
|
Leaf sub-skills MUST NOT emit agent findings: their scope is bounded by the knowledge subset they evaluate. The self-review pass is a super-skill responsibility.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ Set `confidence` to:
|
||||||
- `medium` when detection relies on heuristics or when any frontmatter dimension was `unknown`.
|
- `medium` when detection relies on heuristics or when any frontmatter dimension was `unknown`.
|
||||||
- `low` when the finding is an advisory derived only from applicability.
|
- `low` when the finding is an advisory derived only from applicability.
|
||||||
|
|
||||||
|
When the knowledge file ships an unambiguous `.good.al` companion that names exactly the correction the finding requires (and the diff context makes the substitution mechanical), set `findings[].suggested-code` to the literal replacement for the source lines indicated by `location`. The payload must be a verbatim replacement — no diff markers, no fences, no commentary — that the consumer can render as a one-click suggestion. Skip the field when the appropriate fix depends on context the skill cannot determine, or when more than one defensible replacement exists. See `skills/do.md` for the full contract.
|
||||||
|
|
||||||
Outcome selection:
|
Outcome selection:
|
||||||
|
|
||||||
- `completed` — the skill evaluated every worklist item; default when the skill finishes normally, including when the resulting `findings` array is empty.
|
- `completed` — the skill evaluated every worklist item; default when the skill finishes normally, including when the resulting `findings` array is empty.
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ Set `confidence` to:
|
||||||
- `medium` when detection relies on heuristics or when any frontmatter dimension was `unknown`.
|
- `medium` when detection relies on heuristics or when any frontmatter dimension was `unknown`.
|
||||||
- `low` when the finding is an advisory derived only from applicability.
|
- `low` when the finding is an advisory derived only from applicability.
|
||||||
|
|
||||||
|
When the knowledge file ships an unambiguous `.good.al` companion that names exactly the correction the finding requires (and the diff context makes the substitution mechanical), set `findings[].suggested-code` to the literal replacement for the source lines indicated by `location`. The payload must be a verbatim replacement — no diff markers, no fences, no commentary — that the consumer can render as a one-click suggestion. Skip the field when the appropriate fix depends on context the skill cannot determine, or when more than one defensible replacement exists. See `skills/do.md` for the full contract.
|
||||||
|
|
||||||
Outcome selection:
|
Outcome selection:
|
||||||
|
|
||||||
- `completed` — the skill evaluated every worklist item; default when the skill finishes normally, including when the resulting `findings` array is empty.
|
- `completed` — the skill evaluated every worklist item; default when the skill finishes normally, including when the resulting `findings` array is empty.
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ Set `confidence` to:
|
||||||
- `medium` when detection relies on heuristics or when any frontmatter dimension was `unknown`.
|
- `medium` when detection relies on heuristics or when any frontmatter dimension was `unknown`.
|
||||||
- `low` when the finding is an advisory derived only from applicability.
|
- `low` when the finding is an advisory derived only from applicability.
|
||||||
|
|
||||||
|
When the knowledge file ships an unambiguous `.good.al` companion that names exactly the correction the finding requires (and the diff context makes the substitution mechanical), set `findings[].suggested-code` to the literal replacement for the source lines indicated by `location`. The payload must be a verbatim replacement — no diff markers, no fences, no commentary — that the consumer can render as a one-click suggestion. Skip the field when the appropriate fix depends on context the skill cannot determine, or when more than one defensible replacement exists. See `skills/do.md` for the full contract.
|
||||||
|
|
||||||
Outcome selection:
|
Outcome selection:
|
||||||
|
|
||||||
- `completed` — the skill evaluated every worklist item; default when the skill finishes normally, including when the resulting `findings` array is empty.
|
- `completed` — the skill evaluated every worklist item; default when the skill finishes normally, including when the resulting `findings` array is empty.
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,8 @@ Set `confidence` to:
|
||||||
- `medium` when detection relies on heuristics or when any frontmatter dimension was `unknown`.
|
- `medium` when detection relies on heuristics or when any frontmatter dimension was `unknown`.
|
||||||
- `low` when the finding is an advisory derived only from applicability.
|
- `low` when the finding is an advisory derived only from applicability.
|
||||||
|
|
||||||
|
When the knowledge file ships an unambiguous `.good.al` companion that names exactly the correction the finding requires (and the diff context makes the substitution mechanical), set `findings[].suggested-code` to the literal replacement for the source lines indicated by `location`. The payload must be a verbatim replacement — no diff markers, no fences, no commentary — that the consumer can render as a one-click suggestion. Skip the field when the appropriate fix depends on context the skill cannot determine, or when more than one defensible replacement exists. See `skills/do.md` for the full contract.
|
||||||
|
|
||||||
Outcome selection:
|
Outcome selection:
|
||||||
|
|
||||||
- `completed` — the skill evaluated every worklist item.
|
- `completed` — the skill evaluated every worklist item.
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,8 @@ Set `confidence` to:
|
||||||
- `medium` when detection relies on heuristics (judging whether a caption is a noun phrase or a sentence phrase) or when any frontmatter dimension was `unknown`.
|
- `medium` when detection relies on heuristics (judging whether a caption is a noun phrase or a sentence phrase) or when any frontmatter dimension was `unknown`.
|
||||||
- `low` when the finding is an advisory derived only from applicability.
|
- `low` when the finding is an advisory derived only from applicability.
|
||||||
|
|
||||||
|
When the knowledge file ships an unambiguous `.good.al` companion that names exactly the correction the finding requires (and the diff context makes the substitution mechanical), set `findings[].suggested-code` to the literal replacement for the source lines indicated by `location`. The payload must be a verbatim replacement — no diff markers, no fences, no commentary — that the consumer can render as a one-click suggestion. Skip the field when the appropriate fix depends on context the skill cannot determine, or when more than one defensible replacement exists. See `skills/do.md` for the full contract.
|
||||||
|
|
||||||
Outcome selection:
|
Outcome selection:
|
||||||
|
|
||||||
- `completed` — the skill evaluated every worklist item.
|
- `completed` — the skill evaluated every worklist item.
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ Set `confidence` to:
|
||||||
- `medium` when detection relies on heuristics or when any frontmatter dimension was `unknown`.
|
- `medium` when detection relies on heuristics or when any frontmatter dimension was `unknown`.
|
||||||
- `low` when the finding is an advisory derived only from applicability.
|
- `low` when the finding is an advisory derived only from applicability.
|
||||||
|
|
||||||
|
When the knowledge file ships an unambiguous `.good.al` companion that names exactly the correction the finding requires (and the diff context makes the substitution mechanical), set `findings[].suggested-code` to the literal replacement for the source lines indicated by `location`. The payload must be a verbatim replacement — no diff markers, no fences, no commentary — that the consumer can render as a one-click suggestion. Skip the field when the appropriate fix depends on context the skill cannot determine, or when more than one defensible replacement exists. See `skills/do.md` for the full contract.
|
||||||
|
|
||||||
Outcome selection:
|
Outcome selection:
|
||||||
|
|
||||||
- `completed` — the skill evaluated every worklist item.
|
- `completed` — the skill evaluated every worklist item.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue