Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 64 additions & 2 deletions doc/high_risk_pre_merge_readiness.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ observed results. The independent reviewer checks that the case really reaches
the affected branch and that the failure is causal, not a setup error. Every
changed production path under `lib/`, `tool/`, `hook/`,
`packages/genkit_llamadart/lib/`, `.github/workflows/`, or `.github/actions/`
needs this coverage. Workflows and composite actions count because the
needs this coverage unless it is
[proven comment-only](#comment-only-production-changes). Workflows and composite actions count because the
classifier treats each one as high-risk and the tooling tests that load them
are their only durable proof; no other `.github/` or policy path is a
production reference. The independent Genkit
Expand Down Expand Up @@ -157,6 +158,66 @@ independent audit must inspect those semantics and results; do not invent a
record for tests that were not run. Unknown or unproven reachability blocks the
review even if local JSON validation succeeds. No new approval identity is added.

### Comment-only production changes

A changed production path needs no `test_evidence` coverage when Git proves
the edit comment-only. When every changed production path is proven,
`affected_test_paths` and `test_evidence` may be empty. There is no caller
flag: the evaluator derives the proof from the exact base and head blobs
(`isCommentOnlyDartChange` in `tool/testing/high_risk_readiness.dart`).

A path qualifies only if:

- it is a `.dart` production path changed in place (`M`, no rename or copy)
and a regular non-executable blob at both revisions;
- both revisions parse without diagnostics and scan to identical tokens, type
and lexeme, so string contents, directives, annotations, imports, exports and
the script tag are compared;
- whitespace changes only between two tokens whose comments changed, and the
later token starts its line in both revisions: edited comments are full-line
or trailing, never inline before code;
- every comment added, removed or moved is plain prose or Dartdoc. It contains
no control, invisible or bidirectional character and no tool marker:
language version (`// @dart`), `@docImport`, Dartdoc directives (`{@...}`,
`@nodoc`, any `@name`), `ignore:`/`ignore_for_file:`, `coverage:`,
`dart format`, excerpt regions (`#docregion`, any `#name`) or a security or
lint suppression (`nosemgrep`, `nosec`, `NOSONAR`, `lgtm`, `codeql`, `noqa`,
`nolint`, `expect_lint`, `pragma` and similar). An unchanged
`ignore_for_file:`, `coverage:ignore-file` or `// @dart=` comment may precede
an edited one at the same token; any other marker there fails closed;
- the file is not generated: no `.g`, `.freezed`, `.mocks`, `.gr` or protobuf
suffix, no comment before the first token mentioning `generated` (including
`@generated`) or `do not edit`/`do not modify`, and no comment anywhere that
starts with `AUTO GENERATED`, `GENERATED FILE/CODE`, `Generated by`,
`Code generated` or `DO NOT EDIT`;
- the file is not in `rawTextConsumedSources`: production sources whose raw
text, comments included, repository tooling reads with regular expressions.
These are the release pins (`lib/src/hook/native_release_pins.dart`, read
by the release-docs verifier, the WebGPU bridge tag check, validation
bundles and the native sync scripts), `lib/src/web_setup/web_bridge_setup.dart`
(bridge tag check), and `lib/src/backends/litert_lm/litert_lm_runtime.dart`
and `hook/build.dart` (rewritten by `sync_native_release_pins.py`). A
commented-out pin there can change what a CI gate or sync script reads. A
test fails if a listed path disappears; add any new raw-text reader's source
to the list.

Code inside doc comments is inert and qualifies. Anything else, including
malformed source, an unreadable or non-UTF-8 blob and non-Dart paths, keeps
the ordinary causal-test requirement. The proof covers compiled behavior:
stack-trace line numbers can still shift, and tooling that reads source text
is handled only by the list above. `check_platform_boundaries.dart` also
scans raw lines for directives; because no edited comment can precede code on
its line, a comment edit can only add a violation there, never hide one.

The route changes only that coverage obligation. Classification, surfaces,
matrix rows, the exact-pair independent audit and the zero-P1 and
zero-thread gates are unchanged. A comment-only structured-output path keeps
its minimum impacts, coverage axes and family evidence, and impact review must
still cite it. Other changed production paths in the same PR still need
coverage. A cited test may still reference only comment-only paths and must
pass every existing check. A PR with no changed production path at all still
cites a relevant test.

### Schema migration

New evidence uses `schema_version: 2.0.0`. The current evaluator rejects v1;
Expand Down Expand Up @@ -317,7 +378,8 @@ LLAMADART_ANALYZER_COMPATIBILITY_VERSIONS=8.0.0,8.4.1,14.6.0 \
```

This opt-in test resolves the full root dependency graph offline in scratch
packages and checks CLI compilation plus the namespace regressions. Missing
packages and checks CLI compilation plus the namespace and comment-only
regressions. Missing
requested cached dependencies fail qualification; a skipped test is no proof.

This proof bounds the additive namespace and existing loading dependencies; it
Expand Down
Loading
Loading