mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 14:46:55 +01:00
Merge main into AL development guidance
Reconcile the read-only plan-enrichment contracts with main's folder-review inputs and documentation structure. Record Windows alternate streams in runner evidence and clear the regression harness exit status after expected negative probes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 638b66d2-9f06-4f60-8781-808709e1485c
This commit is contained in:
commit
332947bcdb
298 changed files with 1818 additions and 780 deletions
|
|
@ -56,7 +56,9 @@ the layered policy. `al-code-review` remains distinct from BC-ALAgents'
|
|||
separately installed `al-review` skill, avoiding a collision in hosts that use
|
||||
one shared skill inventory. References from adapters to Entry, and from a
|
||||
dispatched super-skill to its leaves, are intentional progressive disclosure.
|
||||
This avoids registering every internal protocol file as an ambient host skill
|
||||
while allowing each review domain to run in an isolated context.
|
||||
|
||||
These contracts are stable. Changes require a PR approved by both maintainers.
|
||||
|
||||
For the end-to-end flow — from orchestrator trigger through to findings integration — see [`../agent-consumption.md`](../agent-consumption.md). For the high-level project framing, see [`../README.md`](../README.md).
|
||||
For the end-to-end flow — from orchestrator trigger through to findings integration — see [How agents consume BCQuality](../docs/agent-consumption.md). For the high-level project framing, see [`../README.md`](../README.md).
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: al-code-review
|
||||
description: Review Business Central AL code changes using BCQuality's curated rules. Use for an AL pull request, working-tree diff, branch, or individual AL file when BCQuality is installed as a standalone plugin.
|
||||
description: Review Business Central AL code using BCQuality's curated rules. Use for an AL app folder, pull request, working-tree diff, branch, or individual AL file when BCQuality is installed as a standalone plugin.
|
||||
---
|
||||
|
||||
# AL code review
|
||||
|
|
@ -21,8 +21,11 @@ context and execute the resulting dispatch.
|
|||
- Copy the caller's actual request verbatim into `goal`; do not replace a
|
||||
focused request such as "review performance" with a generic full-review
|
||||
goal.
|
||||
- Set `inputs-available` to the inputs actually available to the review,
|
||||
normally `pr-diff` for changes or `file-path` for one file.
|
||||
- Set `inputs-available` to the inputs actually available to the review:
|
||||
`folder-path` for an app or source folder, `pr-diff` for changes, or
|
||||
`file-path` for one file. Pass the caller's actual path with the selected
|
||||
input type; for a whole-app request in the current working directory, use
|
||||
that directory as the `folder-path`.
|
||||
- Set `technologies: [al]` when the input is known to be AL.
|
||||
- Pass `bc-version`, `countries`, and `application-area` only when supplied
|
||||
or reliably determined.
|
||||
|
|
@ -66,4 +69,3 @@ where a consumer prunes its checkout to policy before the agent runs and the
|
|||
index is rebuilt over the pruned tree. Treat `BCQUALITY_ENABLED_LAYERS` as a
|
||||
selection filter, never as a security boundary. A host that needs a genuine
|
||||
deny mechanism must prune the installed tree itself.
|
||||
|
||||
|
|
|
|||
65
skills/do.md
65
skills/do.md
|
|
@ -19,7 +19,12 @@ An action skill is a single markdown file with YAML frontmatter. It lives inside
|
|||
- `/community/skills/` — community-contributed action skills.
|
||||
- `/custom/skills/` — partner or customer action skills (typically in a consumer repo, not in BCQuality itself).
|
||||
|
||||
Action skills do not live at the repo root. The files in `/skills/` — the three meta-skill contracts (READ, DO, WRITE) and the entry-point skill (`entry.md`, `kind: entry-point`) — are the only skills that sit outside a layer. The entry-point skill structurally follows this same four-step pattern but produces a dispatch record rather than an action-skill report; see `skills/entry.md` for its contract.
|
||||
Action skills do not live at the repo root. Layer-independent files in
|
||||
`/skills/` contain the three meta-skill contracts (READ, DO, WRITE), the
|
||||
entry-point skill (`entry.md`, `kind: entry-point`), and host-format adapters.
|
||||
Adapters are not action skills. Entry structurally follows the same
|
||||
four-step pattern but produces a dispatch record rather than an action-skill report;
|
||||
see [entry.md](entry.md) for its contract.
|
||||
|
||||
## Skills hold mechanics; knowledge files hold BC facts
|
||||
|
||||
|
|
@ -56,13 +61,29 @@ application-area: [all]
|
|||
|
||||
`bc-version`, `technologies`, `countries`, `application-area` are optional filters that let an orchestrator pre-select applicable skills for a task. They follow the same semantics as in READ.
|
||||
|
||||
`inputs` is a list of abstract input types the skill **accepts**. Standard values: `pr-diff`, `object-list`, `file-path`, `repository`, `telemetry-query`, `development-plan`. Semantics are any-of: the orchestrator supplies whichever listed input types it has, and the skill is invoked with a non-empty subset of its declared `inputs`. A skill that cannot proceed with the supplied subset MUST return `outcome: "not-applicable"`.
|
||||
`inputs` is a list of abstract input types the skill **accepts**. Standard values:
|
||||
`pr-diff`, `object-list`, `file-path`, `folder-path`, `repository`,
|
||||
`telemetry-query`, and `development-plan`. Semantics are any-of: the
|
||||
orchestrator supplies whichever listed input types it has, and the skill is
|
||||
invoked with a non-empty subset of its declared `inputs`. A skill that cannot
|
||||
proceed with the supplied subset MUST return `outcome: "not-applicable"`.
|
||||
|
||||
`outputs` is always a single-element list naming the output kind:
|
||||
|
||||
- `findings-report` — evaluates an input and reports defects or observations.
|
||||
- `development-guidance-report` — selects and summarizes applicable BCQuality knowledge for an existing development plan without changing the target repository.
|
||||
|
||||
`file-path` is one file. `folder-path` is a directory whose recursively
|
||||
contained files form the complete current-state input, such as a Business
|
||||
Central app folder containing `app.json` and AL source. The input value is the
|
||||
actual path, not merely the name of the input type. The agent MUST enumerate
|
||||
the folder rather than reducing it to one representative file.
|
||||
|
||||
Review skills use terms such as "diff", "changed files", and "changed code" as
|
||||
shorthand for the supplied review scope. For `folder-path`, every relevant file
|
||||
under the folder is in scope. A folder supplies no historical baseline:
|
||||
comparison-only rules MUST NOT infer a prior state that was not provided.
|
||||
|
||||
`sub-skills` is an optional field. When present and non-empty, the skill is a **super-skill** that composes other action skills; see *Composition* below. Values are repo-relative paths to action-skill files.
|
||||
|
||||
## Required sections
|
||||
|
|
@ -238,7 +259,7 @@ Omit `suggested-code` only when the appropriate fix depends on context the skill
|
|||
- `reference` — the suppressed file (same object shape as `findings[].references`).
|
||||
- `reason` — `layer-precedence` when another layer won under READ's precedence rules; `configuration` when the consumer disabled the file's layer.
|
||||
|
||||
**`sub-results`** — super-skills only. Array of complete findings-reports, one per sub-skill that was invoked (i.e., every sub-skill not listed in `skipped-sub-skills`). Each entry MUST itself conform to this output contract. Leaf skills MUST NOT emit `sub-results`.
|
||||
**`sub-results`** — super-skills only. Array of complete findings-reports, one per sub-skill that was invoked (i.e., every sub-skill not listed in `skipped-sub-skills`). Each entry MUST itself conform to this output contract. Entries MUST appear in the worklist's declared order, regardless of invocation or completion order. Leaf skills MUST NOT emit `sub-results`.
|
||||
|
||||
**`skipped-sub-skills`** — super-skills only. Array of sub-skills that were declared in frontmatter but not invoked. `reason` is `configuration` when the orchestrator disabled the sub-skill, or `not-applicable` when the super-skill's Relevance step ruled it out.
|
||||
|
||||
|
|
@ -325,6 +346,20 @@ A **super-skill** is an action skill whose frontmatter declares a non-empty `sub
|
|||
|
||||
Composition is flat: a super-skill MAY list only leaf skills (skills without their own `sub-skills`). Nested super-skills are not permitted in v1.
|
||||
|
||||
### Scheduling boundary
|
||||
|
||||
The super-skill defines which leaves must run, the input and output contracts,
|
||||
and how their results are composed. It does not prescribe a model, concurrency
|
||||
limit, retry policy, or telemetry system. Those choices belong to the
|
||||
orchestrator.
|
||||
|
||||
Each leaf invocation MUST remain a discrete evaluation with its own complete
|
||||
findings-report. An orchestrator MAY execute independent leaves serially or
|
||||
concurrently, but MUST invoke every worklisted leaf, preserve `sub-results` in
|
||||
the declared worklist order, and wait for every invocation to finish before
|
||||
performing any super-skill self-review or final rollup. Scheduling MUST NOT
|
||||
change relevance, coverage, failure, reference-integrity, or output semantics.
|
||||
|
||||
### Section interpretation for super-skills
|
||||
|
||||
The five required sections still apply. Their meaning shifts from knowledge files to sub-skills:
|
||||
|
|
@ -351,7 +386,13 @@ When the worklist is empty (every sub-skill was skipped), `outcome` is `not-appl
|
|||
|
||||
### Rolled-up summary
|
||||
|
||||
`summary.counts` is the sum of sub-skill counts. `summary.coverage.worklist-size` and `items-evaluated` are the sums across invoked sub-skills.
|
||||
`summary.counts` counts the findings in the super-skill's final top-level
|
||||
`findings[]`, after failed sub-results have been excluded and duplicates have
|
||||
been merged. It MUST NOT be calculated by summing sub-skill counts, because the
|
||||
same concern may appear in more than one sub-result.
|
||||
|
||||
`summary.coverage.worklist-size` and `items-evaluated` are the sums across
|
||||
invoked sub-skills whose outcomes are not `failed`.
|
||||
|
||||
### Suppression scope
|
||||
|
||||
|
|
@ -359,15 +400,16 @@ A super-skill's top-level `suppressed[]` remains knowledge-file-only and is typi
|
|||
|
||||
## Worked example
|
||||
|
||||
A minimal action skill that cites applicable guidance for a changed AL file, without generating findings of its own:
|
||||
A minimal action skill that reviews a changed AL file against applicable
|
||||
guidance. Relevance alone never produces a finding:
|
||||
|
||||
```yaml
|
||||
---
|
||||
kind: action-skill
|
||||
id: cite-applicable-guidance
|
||||
id: review-applicable-guidance
|
||||
version: 1
|
||||
title: Cite applicable guidance
|
||||
description: Lists knowledge files relevant to a changed AL file.
|
||||
title: Review applicable guidance
|
||||
description: Reviews a changed AL file against applicable knowledge.
|
||||
inputs: [file-path]
|
||||
outputs: [findings-report]
|
||||
technologies: [al]
|
||||
|
|
@ -385,7 +427,12 @@ Filter by `technologies: [al]` and `bc-version` matching the target environment.
|
|||
Intersect `keywords` with tokens derived from the target file's object name and changed members.
|
||||
|
||||
## Action
|
||||
For each worklist entry, emit one finding with severity `info`, a message naming the concern, and a reference object pointing to the knowledge file.
|
||||
Read each worklisted article in full and compare its normative guidance to the
|
||||
input. Emit a finding only for a concrete violation or an observation the
|
||||
article explicitly defines, with justified severity, evidence, and a reference
|
||||
copied from the discovered article path. Do not report an article merely
|
||||
because it was relevant. If every item was evaluated and none warrants a
|
||||
finding, return `completed` with an empty `findings` array.
|
||||
|
||||
## Output
|
||||
Conforms to the DO output contract.
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ task-context:
|
|||
- repository
|
||||
- pr-diff
|
||||
- file-path
|
||||
- folder-path
|
||||
technologies: [al]
|
||||
bc-version: 28
|
||||
countries: [w1]
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ title: Schema + Use — how to read a knowledge file
|
|||
|
||||
# READ
|
||||
|
||||
Every consumer of BCQuality — an agent, an action skill, a human reviewer — reads this file first. It defines what a knowledge file is, what fields it contains, what they mean, and how to reconcile multiple files.
|
||||
Read this contract before interpreting knowledge files. Task execution starts
|
||||
at [Entry](entry.md); READ is loaded on demand when a dispatched skill needs
|
||||
it. It defines knowledge fields, their meaning, and how to reconcile files.
|
||||
|
||||
This contract is stable. Changes require a PR approved by both maintainers.
|
||||
|
||||
|
|
@ -131,7 +133,7 @@ Rules:
|
|||
|
||||
- A sample file is identified by the article's slug followed by a `.<kind>.<ext>` suffix. The supported kinds are `good` and `bad`. Additional kinds MAY be introduced by a layer; consumers MUST ignore unknown kinds without failing.
|
||||
- The extension matches the technology (`al`, `ps1`, `js`, `kql`, …). A single article MAY carry samples in multiple technologies if the article's frontmatter `technologies` lists them.
|
||||
- Articles MAY have a `good` sample only, a `bad` sample only, both, or neither. The article text SHOULD reference each sample it ships, using a relative path like `` `<slug>.good.al` ``.
|
||||
- Articles MAY have a `good` sample only, a `bad` sample only, both, or neither. The article text SHOULD reference each sample it ships with a relative Markdown link whose label retains the backticked filename, like `` [`<slug>.good.al`](<slug>.good.al) ``.
|
||||
- Samples are **demonstration-only**. They are not deployed, not compiled as part of a published app, and not derived from the Business Central base application source. Each sample is self-contained and exists purely to make the accompanying article concrete for humans and agents.
|
||||
- Layer precedence applies to sample files the same way it applies to articles: a `/custom/knowledge/<domain>/<slug>.good.al` overrides a `/microsoft/knowledge/<domain>/<slug>.good.al` for the same article in the same layer hierarchy.
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Before authoring anything, confirm a knowledge file is the right artifact. BCQua
|
|||
- **Skills** (`*/skills/**`) hold only finder/applier mechanics — how to discover, filter, worklist, and emit findings. See `skills/do.md`.
|
||||
- **Knowledge files** (`*/knowledge/**`) hold every Business-Central-specific fact a skill acts on.
|
||||
|
||||
A new BC fact is therefore a knowledge file, never a skill edit. In particular, if you arrived here because a review agent flagged something it should not have (a false positive) or missed something it should have caught, the remedy is a knowledge file — apply the admission test in the [README](../README.md#what-belongs-here): *would a capable LLM get this wrong without the file?* If you find yourself editing a skill to stop it flagging something, stop and write a knowledge file instead.
|
||||
A new BC fact is therefore a knowledge file, never a skill edit. In particular, if you arrived here because a review agent flagged something it should not have (a false positive) or missed something it should have caught, the remedy is a knowledge file — apply the [admission test](../docs/contributing.md#what-belongs-here): *would a capable LLM get this wrong without the file?* If you find yourself editing a skill to stop it flagging something, stop and write a knowledge file instead.
|
||||
|
||||
### Negative knowledge is first-class
|
||||
|
||||
|
|
@ -56,6 +56,13 @@ Target under 100 lines. Ideal under 50. Long files almost always mean two concer
|
|||
|
||||
Custom `##` sections are permitted when they serve the concern (for example, `## Applies to` for scope caveats or `## See also` for related files). Consumers are not required to understand them, so do not put load-bearing content there.
|
||||
|
||||
When adding or changing a platform claim, cite an authoritative public source
|
||||
where available. A short `## References` section can link the relevant API,
|
||||
property documentation, or public source definition. If no such source is
|
||||
available, identify the evidence or policy basis explicitly; do not imply an
|
||||
official guarantee. Keep the actual rule and its exceptions in normative
|
||||
sections, not only in references. See [sources and examples](../docs/contributing.md#sources-and-examples).
|
||||
|
||||
## No fenced code blocks
|
||||
|
||||
Knowledge files do not contain code. Samples live as **sibling files** next to the article — `<slug>.good.al`, `<slug>.bad.al`, etc. — in the same knowledge-layer folder. See `skills/read.md` for the full convention. This keeps knowledge files retrieval-friendly and prevents code from drifting out of sync with BC platform changes buried inside prose.
|
||||
|
|
@ -93,7 +100,7 @@ The `/custom/` layer is **empty by default** in the upstream `microsoft/BCQualit
|
|||
Before authoring or scaffolding any file under `/custom/knowledge/` or `/custom/skills/`, an author — human or agent — MUST confirm the working repository is **not** `microsoft/BCQuality`:
|
||||
|
||||
- Check the `origin` remote: `git remote get-url origin`. If it points at `github.com/microsoft/BCQuality`, stop — you are in the upstream repo, not a fork.
|
||||
- If you are in the upstream repo, do not write the file. Either fork the repository (or clone it into your organization's own repo) and add the custom content there, or — if the guidance is genuinely shareable — author it in `/community/knowledge/` instead.
|
||||
- If you are in the upstream repo, do not write the custom file. Either fork the repository (or clone it into your organization's own repo) and add the custom content there, or — if the guidance is genuinely shareable — use the shared layer that owns the domain, following *Choosing a layer* above. Community is not a staging area for Microsoft-owned domains.
|
||||
|
||||
A pull request that adds `/custom/` content to `microsoft/BCQuality` will be **automatically closed** by the `Guard custom layer` workflow. Validate the fork precondition first so authoring effort is not wasted on a PR that cannot be merged.
|
||||
|
||||
|
|
@ -109,7 +116,8 @@ Before opening a pull request:
|
|||
- Frontmatter `domain` exactly matches the containing domain folder.
|
||||
- File is in the correct layer and domain folder.
|
||||
- Name is kebab-case and descriptive.
|
||||
- Every companion sample is referenced by filename from the article, and every referenced sample exists.
|
||||
- Every companion sample has a clickable relative link retaining its backticked filename, and every referenced sample exists.
|
||||
- Platform claims link supporting sources where available; policy or empirical guidance is identified as such.
|
||||
- Every review-leaf domain has at least one article with both `.good.al` and `.bad.al` companions; the evaluation harness derives positive and clean controls from that convention automatically.
|
||||
|
||||
Agents scaffolding new files SHOULD run this checklist programmatically before emitting the file.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue