Repository navigation
Commit 7215b37
authored
* 🛡️ Install the review component graph from the package (#83)
The review and repository-analysis components lived in `.reviews/` and every
entrypoint reached them with `--include`, which made the component graph a
property of the checkout being reviewed: a pull request could add its own
`Finding.md` and the review would run the branch's copy while reporting on it.
`@executablemd/code-review-agent` now owns the graph and declares it to the
`run` profile. Thirty-five packaged Markdown components — twenty-eight review
components, five policies, and review-owned copies of `Sample.md` and
`Instruction.md` — cross as `Markdown()` declarations carrying the packaged
bytes, a package-and-asset origin, and the digest this build ships. The six
TypeScript components cross as reserved registrations. Both tiers mean the
host claims the name, so a same-named checkout file is not chosen, and a
second claim on one name is refused at admission rather than ordered.
`src/review-components.ts` is the only assembly boundary, and the CLI attaches
it through one helper wherever the `run` profile is built: ordinary execution,
a nested `<Execution host="run">`, the syntax/validation registry, `<Plan>`'s
admission validator, and `xmd plan`'s candidate validation. `xmd test` at its
root claims none of it; its run child claims all of it.
Ordinary inclusion and repository discovery are untouched — only these
forty-one names are spoken for.
This commit establishes the boundary only. The `.reviews` definitions and
every task and workflow `--include` argument stay in place, and the trusted
tier now wins over them, so the existing entrypoints remain runnable while
this is reviewed.
* 🔥 Retire the checkout-relative review components (#83)
Every supported review and repository-analysis entrypoint now takes its
component graph from the installed code-review package. The five `deno.json`
tasks and the two Actions workflows pass no component `--include`, and the
executable definitions under `.reviews/components/` and the five
`.reviews/policies/*.md` are deleted.
While a command still passed `--include .reviews/components`, the retired
directory was a live dependency of that command: restoring a file under it put
a checkout-supplied component back in front of a review. Removing the argument
is what makes the boundary from the previous commit load-bearing.
What stays in `.reviews/` is this repository's own review programs, the sensor
profile, and the journals and provisioned binaries a run reads and writes —
inputs and outputs, not component definitions.
Tool scopes and behavioral fixtures follow the files: `check`, `lint` and `fmt`
drop the deleted directory, the two lint-scope tests drop it from `LINTED`, and
the review, Oxlint-policy, schema-conformance and UnusedInDiff suites read the
package assets. A new case parses the five tasks and both workflows and refuses
any of the three retired paths, scoped by name so the unrelated core smoke
includes in `ci.yml` stay valid.
The unrelated `packages/core/components` includes in `ci.yml`, the general core
`Sample`/`Instruction` tests, and the deliberate byte-equivalence assertion are
unchanged.
* 🔧 Regenerate the publish workflow for the new dependency edges (#83)
`scripts/gen-publish-workflow.md` derives the publish job graph from the
workspace manifests, and this stack changed two edges: the code-review package
now depends on core and runtime for its declarations, and the CLI depends on
the code-review package. So `code-review-agent` gains those `needs`, moves
ahead of the CLI, and the CLI waits on it.
Generated output — `deno task gen:publish-workflow`, which CI re-runs and
diffs. No hand edits.
* 📝 Document the review components the run profile now advertises (#83)
Installing the graph put 35 names into the vocabulary `xmd syntax` and
`<Syntax />` advertise, and none of them carried a description. SX2 in
`packages/cli/tests/syntax-cli.test.ts` refuses an undocumented complete
built-in, and it was right to: a reader cannot tell "nobody has written this
yet" from "this component has nothing to say", and an agent handed the catalog
got 35 names with no prose.
A declared Markdown component documents itself from its own frontmatter, the
way `Plan.md` does, so each now states a description — plus `as` and `context`
where they apply — following `.agents/component-descriptions.md`.
`Sample.md` and `Instruction.md` state theirs inside their `meta:` block rather
than at the top level. `parseMeta()` treats an explicit `meta:` block as the
whole of a definition's metadata and ignores top-level keys, so a top-level
description on those two is read by nobody. Their `packages/core/components/`
originals get the identical prose, which keeps the two copies byte-identical
and is what the equivalence assertion is for.
This is frontmatter metadata: it takes no part in expansion, resolution,
validation, authority or the journal, so no schema, form, return or behavior
moves. The declaration digests change with the bytes, as they should.
* 🐛 Ship packaged documents that sit in subdirectories (#83)
`packagedDocuments()` lists `src/documents/` recursively and every entry it
returns becomes a `copyFile`. A recursive listing names the directories as well
as the files inside them, so the first package whose documents are not flat
fails the whole npm build with `EINVAL` — "the source path is neither a regular
file nor a symlink to a regular file".
Nothing had noticed because `packages/cli/src/documents/` is flat. The review
graph keeps its documents under `components/` and `policies/`, so it is the
first, and `packages/code-review-agent` became a CLI dependency in this stack —
which is what put it in the CLI's npm build at all.
Only Node and Bun would have seen it: Deno resolves the assets from the source
tree and stays green, which is why `scripts/tests/cli-npm-bin.test.ts` is where
it surfaced.
Verified by building the package: 30 component documents, 5 policies and
`components.md` land under `npm/esm/src/`.
* 🔧 Read through the package filesystem and prove the graph ships (#83)
Two corrections to `0f179628`.
`stat` comes from `@effectionx/fs` and is yielded directly, so the packaged-
document walk goes through the repository's filesystem like everything else on
this path. `node:fs/promises` keeps only what the package does not provide —
recursive copy, temp directories, and a recursive listing, since its own
`readdir` takes no options — and the import comment now says so.
The npm proof is the contract rather than the symptom. `cli-npm-bin.test.ts`
compares every entry of `REVIEW_DOCUMENTS` against its emitted copy under
`npm/esm/src/documents/`, byte for byte, plus `src/components.md`. Driven by the
manifest rather than a count or a second list: a component added to the graph
and not shipped is exactly what has to fail, and a hand-kept list is what would
not notice. Presence and content are told apart so a missing asset reports as
one instead of an unexplained ENOENT.
Three mutations discriminate it: copying directories as files reproduces the
original EINVAL; skipping nested documents builds a clean package the review
cannot resolve a component from; and altering one emitted document's bytes,
which loads and digests fine, is caught by the byte comparison alone and named.
* 📝 State the review components' GitHub mutations accurately (#83)
Five descriptions promised less than their components do, and three of them
hid a mutation of the pull request entirely.
`<SuggestRemoval>` does not simply replace the previous bot review: it deletes
earlier ones only where GitHub permits deletion, so a submitted review can
remain and the old wording's promise that reviews never stack was not one the
component keeps. It now says what it does — delete where allowed, acknowledge
declined suggestions and resolve their threads, then post pending findings as a
new review.
`<CommentReview>` reconciles inline removal suggestions when findings remain and
the GitHub environment is present, and said nothing about it. `<SlopPolicy>` and
`<PrPolicyReport>` compose it, so an author reading either of them was told they
render a section and not that running one writes to the pull request. All three
now disclose it.
`<RepoPolicyReport>` stated the cleanup issues unconditionally, but
`<CleanupIssues>` does nothing without `GITHUB_TOKEN` and `GITHUB_REPOSITORY`.
`Sample.md` and `Instruction.md` each carried a second copy of one metadata key
at the top level, left behind when the prose moved into their `meta:` blocks.
`parseMeta()` treats an explicit `meta:` block as the complete metadata object,
so those copies were read by nobody — `<Sample>` still reports its `as` and
`context` and `<Instruction>` its `context` with them gone. Both pairs stay
byte-equivalent.
The `unused-in-diff` comment still named `.reviews` as the source it reads.
Descriptive metadata and one comment only: no body, schema, form or return
moves, and nothing asserts on this wording.
1 parent 142b29a commit 7215b37
77 files changed
Lines changed: 1853 additions & 173 deletions
File tree
- .github/workflows
- .reviews
- components
- policies
- packages
- cli
- src
- code-review-agent
- src
- components
- documents
- components
- policies
- core
- components
- tests
- runtime/test
- scripts
- tests
- specs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
| |||
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
121 | | - | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 51 | | |
55 | 52 | | |
56 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 41 | | |
45 | 42 | | |
46 | 43 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
4 | 10 | | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
11 | | - | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
16 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4536 | 4536 | | |
4537 | 4537 | | |
4538 | 4538 | | |
| 4539 | + | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
| 4544 | + | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
| 4572 | + | |
| 4573 | + | |
| 4574 | + | |
| 4575 | + | |
| 4576 | + | |
| 4577 | + | |
| 4578 | + | |
| 4579 | + | |
| 4580 | + | |
| 4581 | + | |
| 4582 | + | |
| 4583 | + | |
| 4584 | + | |
| 4585 | + | |
| 4586 | + | |
| 4587 | + | |
| 4588 | + | |
| 4589 | + | |
| 4590 | + | |
| 4591 | + | |
| 4592 | + | |
| 4593 | + | |
| 4594 | + | |
| 4595 | + | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
| 4599 | + | |
| 4600 | + | |
| 4601 | + | |
4539 | 4602 | | |
4540 | 4603 | | |
4541 | 4604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
0 commit comments