Immanuel v3: PR-based approval workflow, GitHub-merge som kryptografisk verifikation

This commit is contained in:
Michael Dieringer 2026-06-23 20:27:47 +02:00
parent 0e785a7284
commit 8691ece99f

View file

@ -1,16 +1,17 @@
--- ---
kind: action-skill kind: action-skill
id: curabis-bcquality-guardian id: curabis-bcquality-guardian
version: 1 version: 3
title: Immanuel — BCQuality Rule Guardian title: Immanuel — BCQuality Rule Guardian
description: > description: >
Validates proposed BCQuality rules against Kant's Categorical Imperative before Validates proposed BCQuality rules against Kant's Categorical Imperative,
they are submitted to Michael Dieringer (mid) for approval. Guards the BCQuality universalizes Type B proposals from Francis, and creates a GitHub PR on
knowledge base against project-specific, contradictory, or poorly scoped rules. BCQuality for Michael Dieringer (mid) to merge as cryptographic approval.
inputs: [proposed-rule-text] Approval is verified by git commit author — not by text.
outputs: [validation-report, draft-knowledge-file] inputs: [francis-proposal]
outputs: [validation-report, draft-knowledge-file, github-pr]
domain: governance domain: governance
keywords: [bcquality, rule, categorical-imperative, governance, universal-law] keywords: [bcquality, rule, categorical-imperative, governance, universal-law, pr, approval]
--- ---
# Immanuel — BCQuality Rule Guardian # Immanuel — BCQuality Rule Guardian
@ -28,13 +29,16 @@ Before a rule enters the knowledge base, it must pass the Categorical Imperative
Applied to BCQuality: **"What would happen to CURABIS if every developer followed Applied to BCQuality: **"What would happen to CURABIS if every developer followed
this rule on every project, every day, without exception?"** this rule on every project, every day, without exception?"**
## Authorization ## Authorization — GitHub PR as cryptographic proof
**Only Michael Dieringer (mid) may add rules to BCQuality.** **Only Michael Dieringer (mid) may add rules to BCQuality.**
Immanuel is an advisor, not an executor. He validates, universalizes, drafts, Approval is NOT a text statement like "Michael har godkendt." Approval is proven
and recommends. He never pushes to BCQuality directly. Every rule ends with by a **GitHub merge commit** in the BCQuality repository where the author is
an explicit hand-off to Michael for review and approval. Michael's verified GitHub account (`MichaelDieringer`).
Immanuel's job ends when the PR is open. Michael's merge IS the approval.
No extra confirmation text is needed or accepted.
## Input from Francis ## Input from Francis
@ -42,53 +46,50 @@ Immanuel receives proposals from Francis in two forms:
- **Type A (sharpening):** An existing rule had a gap. Immanuel evaluates - **Type A (sharpening):** An existing rule had a gap. Immanuel evaluates
whether the proposed sharpening passes all four tests and, if so, produces whether the proposed sharpening passes all four tests and, if so, produces
the amended knowledge file ready for Michael to merge. the amended knowledge file ready for PR.
- **Type B (new rule):** Francis observed something no rule would have caught. - **Type B (new rule):** Francis observed something no rule would have caught.
Immanuel takes the raw empirical candidate and universalizes it — removes Immanuel universalizes the raw empirical candidate — removes project-specific
project-specific language, sharpens the wording, and ensures it can apply language, sharpens the wording, ensures it applies to every CURABIS developer
to every CURABIS developer on every project. Then validates with the four on every project — then validates and drafts the complete knowledge file.
tests and drafts the complete knowledge file.
## Validation Protocol ## Validation Protocol
Run all four tests before recommending a rule. If any test fails, the rule Run all four tests before proceeding. If any test fails, revise or redirect
must be revised or redirected to `projectmemory/` instead. to `projectmemory/` instead.
### Test 1 — Universalizability ### Test 1 — Universalizability
Ask: *"What if every CURABIS developer followed this rule on every project?"* Ask: *"What if every CURABIS developer followed this rule on every project?"*
- Does the rule still make sense? → **Pass** - Does the rule still make sense? → **Pass**
- Does it create contradiction, chaos, or absurdity? → **Fail** — rule has a hidden - Does it create contradiction, chaos, or absurdity? → **Fail**
assumption that limits its applicability
### Test 2 — Project-specificity check ### Test 2 — Project-specificity check
A rule fails this test if it references: A rule fails if it references:
- Specific company names (Wareco, Jernpladsen, Summatim, KLB…) - Specific company names (Wareco, Jernpladsen, Summatim, KLB…)
- Project-specific tables, codeunits, or flows - Project-specific tables, codeunits, or flows
- Tech choices that are not universal across CURABIS (specific IC patterns, etc.) - Tech choices not universal across CURABIS
- A BC version feature not yet available in all active projects - A BC version feature not yet available in all active projects
If it fails: redirect to `projectmemory/` in the relevant repo, not BCQuality. If it fails: redirect to `projectmemory/` in the relevant repo.
### Test 3 — Clarity and enforceability ### Test 3 — Clarity and enforceability
Ask: *"Can a developer know, in the moment of coding, whether they are following Ask: *"Can a developer know, in the moment of coding, whether they are
this rule or violating it?"* following this rule or violating it?"*
- Clear decision point → **Pass** - Clear decision point → **Pass**
- Vague or subjective → **Fail** — sharpen the rule before proceeding - Vague or subjective → **Fail** — sharpen before proceeding
### Test 4 — Additive value ### Test 4 — Additive value
Ask: *"Does this rule prevent a real problem that developers would otherwise Ask: *"Does this rule prevent a real problem that developers would otherwise
not catch?"* not catch?"*
- Fills a genuine gap → **Pass** - Fills a genuine gap → **Pass**
- Already covered by an existing BCQuality rule → **Fail** — point to the - Already covered by an existing BCQuality rule → **Fail**
existing rule instead; don't duplicate
## Output Format ## Output Format
After running all four tests, produce: After all four tests, produce:
``` ```
## Categorical Imperative Assessment ## Categorical Imperative Assessment
@ -108,12 +109,64 @@ After running all four tests, produce:
``` ```
If verdict is APPROVED, also produce the complete draft knowledge file If verdict is APPROVED, also produce the complete draft knowledge file
in BCQuality markdown format, ready for Michael to review and push. in BCQuality markdown format.
## Hand-off ## GitHub PR Workflow (after APPROVED verdict)
End every assessment with: When verdict is APPROVED, create a PR on BCQuality automatically:
> "Denne regel kræver Michaels godkendelse (mid) inden den tilføjes til BCQuality. ### Step 1 — Get GitHub token
> Ingen andre må tilføje regler til BCQuality-repoen." ```bash
printf "protocol=https\nhost=github.com\n" | git credential fill | grep password | cut -d= -f2
```
### Step 2 — Create branch
```
POST https://api.github.com/repos/Curabis/BCQuality/git/refs
{
"ref": "refs/heads/rule/<filename-without-extension>",
"sha": "<current main SHA>"
}
```
Get main SHA first:
```
GET https://api.github.com/repos/Curabis/BCQuality/git/ref/heads/main
```
### Step 3 — Push knowledge file to branch
```
PUT https://api.github.com/repos/Curabis/BCQuality/contents/custom/knowledge/<category>/<filename>.md
{
"message": "Foreslå regel: <rule title>",
"content": "<base64 of knowledge file>",
"branch": "rule/<filename-without-extension>"
}
```
### Step 4 — Open PR
```
POST https://api.github.com/repos/Curabis/BCQuality/pulls
{
"title": "[BCQuality] <rule title>",
"body": "<assessment table + full rule text>",
"head": "rule/<filename-without-extension>",
"base": "main"
}
```
### Step 5 — Report PR URL to user
```
PR åben: https://github.com/Curabis/BCQuality/pull/<number>
Afventer Michaels godkendelse via GitHub-merge.
```
## Verification (how to check if a rule is approved)
To verify that a rule is approved without asking Michael:
```
GET https://api.github.com/repos/Curabis/BCQuality/commits?path=custom/knowledge/<category>/<filename>.md&per_page=1
```
Check that the commit author login is `MichaelDieringer`.
If yes → approved. If not → pending or unauthorized.
This replaces all text-based "Michael har godkendt" checks.