Skip to content

Add Questions instance sketch (a which-grade) - #24

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/questions-instance
Nov 11, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
claude/questions-instance

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds ResourceAlgebra.Instances.Questions, a sketch of a "which" grade: a grade is the set of downstream questions that a step makes unanswerable, as n booleans. _⊗_ is union and _⊕_ is intersection. The module header states 2 limits of _⊕_ as intersection, and no-branch-achieves-meet shows the first limit.

The module header says "SKETCH, not yet in any ledger". This PR puts the module in the import cone only.

Changes

  • New file src/ResourceAlgebra/Instances/Questions.agda (instance, IsDioid, IsOrdered, IsAnnihilating, and a 2-question example).
  • src/ResourceAlgebra/All.agda: 1 import line for the new module.

RSR Quality Checklist

Required

  • Tests pass: bash scripts/check-agda.sh only (see Testing). just test and just quality were not run.
  • Code is formatted (not run)
  • Linter is clean (not run)
  • No banned language patterns
  • No unsafe blocks without // SAFETY: comments (none)
  • No banned functions (--safe, and the postulate scan passes)
  • SPDX license headers: SPDX-License-Identifier: MPL-2.0 is present. The new file has no SPDX-FileCopyrightText line. That edit is left to the owner.
  • No secrets, credentials, or .env files included

As Applicable

  • README.adoc, CHANGELOG.adoc, docs/status/PROOF-STATUS.adoc, docs/status/ROADMAP.adoc and the deed are not updated. They do not name the new instance.
  • No Rocq or Lean recheck of the new module.

Testing

bash scripts/check-agda.sh passed locally: no postulate in src/, core proofs, unit tests, and all 8 expected rejections.

Local checker: Agda 2.6.3 (Ubuntu agda-bin). CI pins 2.6.4.3, thus the CI run is the authority.

The commit is not signed. The session has no signing key.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added a resource algebra for tracking which downstream questions are lost across sequences and alternatives. Sequential composition marks a question as lost if either step loses it; alternatives mark it as lost only when every branch loses it.
    • Added algebraic properties and examples demonstrating how different loss patterns can combine, even when they involve the same number of lost questions.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a Questions resource algebra that represents losses across a fixed number of downstream questions with Boolean grades. It defines the algebraic operations and proofs, adds two-question examples, and imports the instance in ResourceAlgebra.All.

Changes: Question-loss grades

Layer / File(s) Summary
Grade representation and Boolean operations
src/ResourceAlgebra/Instances/Questions.agda
Defines recursive question-loss grades and constructors. Boolean disjunction combines sequential losses, and conjunction identifies losses shared by alternatives.
Resource algebra instance
src/ResourceAlgebra/Instances/Questions.agda, src/ResourceAlgebra/All.agda
Lifts Boolean laws to grades, defines the Questions resource algebra and its dioid, order, and annihilation proofs, and imports the module through ResourceAlgebra.All.
Two-question examples
src/ResourceAlgebra/Instances/Questions.agda
Defines two distinct grades and proves that sequencing them yields all-lost, while their alternative combination yields none-lost.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related PRs

Suggested reviewers: claude

Merge Risk: Minimal · up to 10686

No concrete merge-blocking issue is established. The module has the required SPDX header; the pinned Agda CI check remains the normal merge check.

- [ ] 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

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 11, 2026 03:59
@hyperpolymath
hyperpolymath merged commit 4666f32 into main Nov 11, 2026
45 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-11T03:59:05.286107Z
We couldn’t complete this review. Comment @codex review to try again.
10686f8 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.

@hyperpolymath
hyperpolymath deleted the claude/questions-instance branch November 11, 2026 03:59
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

hyperpolymath added a commit that referenced this pull request Nov 11, 2026
## Summary

Follow-up to #24. Adds the Rocq and Lean recheck legs for
`ResourceAlgebra.Instances.Questions` and records the instance in the
ledgers.

## Changes

- `verification/proofs/coq/ResourceAlgebra.v`: `Questions`,
`Questions_dioid`, `Questions_ordered`, `Questions_annihilating`, and
the 3 two-question facts, with 5 new `Print Assumptions` lines.
- `verification/proofs/lean4/ResourceAlgebra.lean`: the same theorems,
with 6 new `#print axioms` lines.
- `docs/status/PROOF-STATUS.adoc`: rows Q-1 to Q-4, their statement
correspondence, a note on eta for the carrier, and the limits of `⊕` in
the open list. The census is 26 rows, all ungraded.
- `README.adoc`, `docs/pre-registration.adoc`, `CHANGELOG.adoc`: the
instance is listed.
- `src/ResourceAlgebra/Instances/Questions.agda`: the header points to
the ledger rows and no longer says "SKETCH, not yet in any ledger". No
proof changed. It also gets the `SPDX-FileCopyrightText` line of the
other modules, at the owner's direction.
- `resource-algebra_chora.deed`: `:purpose` names Questions as the fifth
instance. `CLAUDE.md` is regenerated from it with `just claude-md` (just
1.56.0 and nickel 1.17.0, both checksum-checked), and `just
validate-claude-md` passes.

## RSR Quality Checklist

### Required

- [x] Tests pass: see Testing. `just` is not installed in the session,
so the scripts were run directly.
- [ ] Code is formatted (not run)
- [ ] Linter is clean (not run)
- [x] No banned language patterns
- [x] No `unsafe` blocks (none)
- [x] No banned functions (no `Admitted`, no `sorry`, no `postulate`)
- [x] SPDX license headers present on the new and changed source files
- [x] No secrets, credentials, or `.env` files included

### As Applicable

- [x] Repo deed `(ecosystem)` `:purpose` updated, `CLAUDE.md`
regenerated
- [x] Documentation updated
- [x] `CHANGELOG` updated

## Testing

- `bash scripts/check-agda.sh`: pass (Agda 2.6.3 locally; CI pins
2.6.4.3).
- `bash scripts/check-proofs.sh lean4` with Lean 4.35.0 (the pinned
archive, SHA256 checked): pass. 50 of 50 printed theorems depend on no
axiom.
- Rocq: Rocq 9.3.0 was not available locally. The file compiles with Coq
8.18.0 after `From Stdlib` is replaced by `From Coq` in a scratch copy,
and 42 of 42 printed theorems are closed under the global context.
`rocqchk` was not run. The CI Rocq leg is the authority.
- `check-adoc-renders`, `check-invisible-characters`,
`check-no-placeholders`, `check-escape-hatches`, `check-no-md-in-docs`,
`check-root-shape`: pass.

The commit is not signed. The session has no signing key.

---
_Generated by [Claude
Code](https://claude.ai/code/session_0136P7ZngnAq35mYcMvxDyS4)_

---------

Co-authored-by: Claude <[email protected]>
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.

3 participants