Skip to content

fix(k9): preserve conformance evidence and publish compact status reports - #1273

Merged
hyperpolymath merged 3 commits into
mainfrom
work/k9-conformance-reporting
Oct 17, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
work/k9-conformance-reporting

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

The current K9 report posts entire logs on every run and can hide validator failures. This change preserves subprocess exit status and per-file evidence, then publishes one compact, updatable DEED–K9 report.

The table covers DEED syntax, the K9 contract typecheck, validator self-tests, positive/negative controls and the live L0–L2 corpus. It shows pass/fail/indeterminate/N/A counts, comparable-revision arrows and expandable findings. Colours distinguish blocking failures, incomplete evidence, advisory debt, success and explicit scope exclusions. The badge names its syntax/L0–L2 scope; it does not certify signatures or metadata truth.

Full JSON, tool versions and logs are written under tests/conformance/YYYY-MM-DD/pr-N/run-ID-ATTEMPT and uploaded as a 90-day artifact. Existing report comments are updated rather than appended. A generated lock-membership update reuses already-resolved action pins; no dependency digest changed.

Validation:

  • 10 regression tests pass with Bun 1.4.3, including empty output, missing evidence, failed assertions, routed files, debt policy, safe Markdown and generator idempotence.
  • Local Nickel 1.18.0 run: 4 valid deeds, 1 contract typecheck, 34 self-tests, 27 controls, 12 conforming K9 files, 2 routed N/A files.
  • Actions-lock coverage and offline per-workflow verification pass; workflow YAML parses and whitespace checks pass.
  • Hosted K9 workflow 39046786596 passes, including evidence collection, artifact upload and the compact PR comment. Actions lockfile, lock sync and lock self-check gates also pass. Authenticated remote relocking remains unavailable locally; existing resolved digests are unchanged.

Stacked on #1272 to use its repo deed. This PR does not change normative K9 rules or loosen branch protections. Reporting documentation and implementation live in 1-formats/k9/tools/.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 02ce2590-b507-4d3c-a612-48bf0721cd8a
📥 Commits

Reviewing files that changed from the base of the PR and between 3de4300 and 0db2822.

⛔ Files ignored due to path filters: 1
  • .github/workflows/actions.lock is excluded by !**/*.lock
📒 Files selected for processing: 10
  • .githooks/validate-k9.sh
  • .github/workflows/k9-contractile.yml
  • .gitignore
  • 1-formats/k9/tools/CONFORMANCE-REPORTING.adoc
  • 1-formats/k9/tools/README.adoc
  • 1-formats/k9/tools/conformance-report.mjs
  • 1-formats/k9/tools/conformance-report.test.mjs
  • README.adoc
  • scripts/complete-job-refs.sh
  • tests/conformance/README.adoc
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

DEED–K9 green

🟢 conformant · commit 0db282207397 · run 39046984866

Category Status Pass Fail Indeterminate N/A Since previous revision
DEED syntax 🟢 conformant 4 0 0 0 ↔ unchanged
K9 contract typecheck 🟢 conformant 1 0 0 0 ↔ unchanged
K9 validator self-test 🟢 conformant 34 0 0 0 ↔ unchanged
K9 positive/negative controls 🟢 conformant 27 0 0 0 ↔ unchanged
K9 live corpus (L0–L2) 🟢 conformant 12 0 0 2 ↔ unchanged
K9 live corpus (L0–L2): 2 finding(s) / scope notes
  • 2-protocols/k9-coordination/examples/minimal.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.
  • coordination.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.

Scope: DEED syntax and K9 contracts L0–L2. L3 signature verification and routed coordination dialects are not certified. Green is limited to this scope. Orange is missing evidence; grey is an explicit scope exclusion. Logs and report.json are in the dated conformance-evidence artifact on the linked run.

@hyperpolymath
hyperpolymath added this pull request to stack #1274 October 17, 2026 15:51
Base automatically changed from hyperpolymath-patch-1 to main October 17, 2026 15:52
@hyperpolymath
hyperpolymath force-pushed the work/k9-conformance-reporting branch from 5048949 to 0db2822 Compare October 17, 2026 15:52
@hyperpolymath
hyperpolymath marked this pull request as ready for review October 17, 2026 15:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T15:59:39.212710Z 0db2822 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Autofix was enabled. Check current status in the Coding task.

@hyperpolymath
hyperpolymath merged commit ce768a6 into main Oct 17, 2026
57 of 68 checks passed
@hyperpolymath
hyperpolymath deleted the work/k9-conformance-reporting branch October 17, 2026 15:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0db2822073

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Validate the merge result instead of only the PR head

When the target branch has advanced since the PR branch was created, checking out pull_request.head.sha makes every structural and conformance check run against the contributor's standalone head rather than GitHub's synthetic merge commit. A PR can therefore receive the required green check even though the tree that would be merged with the current base violates these checks; retain the merge checkout for validation and pass the head SHA separately for report identity and changed-file calculations.

Useful? React with 👍 / 👎.

const dirty = execute(root, 'git', ['diff', '--quiet', 'HEAD']).code !== 0;
return { schema: VERSION, profile, tools, dirty, generated: new Date().toISOString(), sha: env.K9_HEAD_SHA || execute(root, 'git', ['rev-parse', 'HEAD']).output.trim(), run: env.GITHUB_RUN_ID || 'local', pr: env.PR_NUMBER || 'local', url: env.GITHUB_RUN_ID ? `https://github.com/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}` : '', categories, state: state(all), counts: counts(all) };
}
const escape = s => String(s).replace(/[&<>|`]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '|': '&#124;', '`': '&#96;' }[c])).replace(/\r?\n/g, ' ');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Escape Markdown syntax in rendered evidence

For a PR containing a K9 filename or diagnostic-controlled value with Markdown such as x** [label](https://example.invalid), this function escapes HTML delimiters but leaves Markdown control characters such as []()*_! and mentions untouched. Because render() interpolates the result directly into the bot's PR comment rather than a code block, a contributor can inject rendered links, images, mentions, or text that visually spoofs the conformance report; escape GitHub-flavored Markdown as well or render these values as code.

Useful? React with 👍 / 👎.

Comment on lines +141 to +143
gh api --paginate --slurp "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" \
| jq -r '[.[][] | select(.user.login == "github-actions[bot]" and (.body | contains("<!-- k9-contractile-report:")))] | last | .body // ""' \
> "$RUNNER_TEMP/k9-previous.md"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep an optional baseline lookup from failing the gate

If the comments API is temporarily unavailable, rate-limited, or denied, set -euo pipefail makes this newly added lookup step fail the required job even though the previous report is optional and the renderer already supports a missing baseline as no comparable baseline. The evidence collector still runs because of always(), so its report can be green while the required check remains red solely because comparison history could not be fetched; handle this lookup failure by writing an empty baseline and continuing.

Useful? React with 👍 / 👎.

Comment on lines +127 to +129
- name: Install reporting runtime
if: ${{ always() }}
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pin the Bun version used by the required gate

When setup-bun changes its default release, this required workflow silently begins running both the reporting regression tests and the DEED validator under a different runtime, so an upstream Bun release can break or alter conformance results without any repository change; it also changes the recorded profile and discards otherwise comparable baselines. The repository's other runtime lanes explicitly pin Bun 1.4.2, so this setup step should likewise specify a reviewed bun-version rather than following the action's moving default.

Useful? React with 👍 / 👎.

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.

1 participant