Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
9 changes: 9 additions & 0 deletions .agents/skills/oracles-design/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: oracles-design
description: Design, write, or change an oracle with @tanstack/oracles. Start from approved potential laws, write the oracle file with its law block and code, choose a model, and build histories that reach the states the law needs. Show the evidence the change needs, and close every gap. Use for a new oracle, an oracle repair, or a production change in owned code. Also use for any change to a model, history grammar, driver, or check.
---

Read `node_modules/@tanstack/oracles/skills/oracles-design/SKILL.md` in full, and follow it.
It matches the installed version of `@tanstack/oracles`. If that file does not
exist, run the repository's install, then look again. If it is still missing,
`@tanstack/oracles` is not installed there: say so and stop.
9 changes: 9 additions & 0 deletions .agents/skills/oracles-evaluate-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: oracles-evaluate-review
description: Evaluate a review of oracle work done with @tanstack/oracles. Keep a lossless ledger of every finding, and check each claim against the code. Extend the oracle so it shows each confirmed bug on unchanged production, then fix production and close the bug class. Use when review findings arrive for a branch that touches an oracle or owned code.
---

Read `node_modules/@tanstack/oracles/skills/oracles-evaluate-review/SKILL.md` in full, and follow it.
It matches the installed version of `@tanstack/oracles`. If that file does not
exist, run the repository's install, then look again. If it is still missing,
`@tanstack/oracles` is not installed there: say so and stop.
9 changes: 9 additions & 0 deletions .agents/skills/oracles-explore/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: oracles-explore
description: 'Explore an area of a codebase with @tanstack/oracles, or the whole repository. Probe the real API to prove each finding, propose a potential oracle and its potential laws, build it, fix confirmed bugs oracle first, and close gaps until bugs or design questions turn up. The first time in a repository, it also onboards the developer: what the session will do, new words explained as they come up, a walk-through, and the choice to finish setting up. Use when someone is trying @tanstack/oracles, asks where an oracle would help, or asks to explore an area ("explore the clearQueue API").'
---

Read `node_modules/@tanstack/oracles/skills/oracles-explore/SKILL.md` in full, and follow it.
It matches the installed version of `@tanstack/oracles`. If that file does not
exist, run the repository's install, then look again. If it is still missing,
`@tanstack/oracles` is not installed there: say so and stop.
9 changes: 9 additions & 0 deletions .agents/skills/oracles-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: oracles-review
description: Review oracle work done with @tanstack/oracles. Challenge whether an oracle enforces its law, whether it is the right law, and whether the work took a shortcut. Use for a new or changed oracle, or a production change in owned code. Also use for a proposed change to what an oracle promises.
---

Read `node_modules/@tanstack/oracles/skills/oracles-review/SKILL.md` in full, and follow it.
It matches the installed version of `@tanstack/oracles`. If that file does not
exist, run the repository's install, then look again. If it is still missing,
`@tanstack/oracles` is not installed there: say so and stop.
9 changes: 9 additions & 0 deletions .agents/skills/oracles-setup/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: oracles-setup
description: Finish setting up a repository for oracles with @tanstack/oracles. Install the latest releases, add the lint preset and the Vitest config, write the agent instructions, make the oracle skills findable by coding agents, and run the oracle through the gap check. Use when the developer wants to keep the work of a first session (a commit, or a pull request), when a repository adopts @tanstack/oracles, or when it upgrades the installed release. Its install and file-placement sections also cover the minimal setup that a first session needs.
---

Read `node_modules/@tanstack/oracles/skills/oracles-setup/SKILL.md` in full, and follow it.
It matches the installed version of `@tanstack/oracles`. If that file does not
exist, run the repository's install, then look again. If it is still missing,
`@tanstack/oracles` is not installed there: say so and stop.
9 changes: 9 additions & 0 deletions .claude/skills/oracles-design/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: oracles-design
description: Design, write, or change an oracle with @tanstack/oracles. Start from approved potential laws, write the oracle file with its law block and code, choose a model, and build histories that reach the states the law needs. Show the evidence the change needs, and close every gap. Use for a new oracle, an oracle repair, or a production change in owned code. Also use for any change to a model, history grammar, driver, or check.
---

Read `node_modules/@tanstack/oracles/skills/oracles-design/SKILL.md` in full, and follow it.
It matches the installed version of `@tanstack/oracles`. If that file does not
exist, run the repository's install, then look again. If it is still missing,
`@tanstack/oracles` is not installed there: say so and stop.
9 changes: 9 additions & 0 deletions .claude/skills/oracles-evaluate-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: oracles-evaluate-review
description: Evaluate a review of oracle work done with @tanstack/oracles. Keep a lossless ledger of every finding, and check each claim against the code. Extend the oracle so it shows each confirmed bug on unchanged production, then fix production and close the bug class. Use when review findings arrive for a branch that touches an oracle or owned code.
---

Read `node_modules/@tanstack/oracles/skills/oracles-evaluate-review/SKILL.md` in full, and follow it.
It matches the installed version of `@tanstack/oracles`. If that file does not
exist, run the repository's install, then look again. If it is still missing,
`@tanstack/oracles` is not installed there: say so and stop.
9 changes: 9 additions & 0 deletions .claude/skills/oracles-explore/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: oracles-explore
description: 'Explore an area of a codebase with @tanstack/oracles, or the whole repository. Probe the real API to prove each finding, propose a potential oracle and its potential laws, build it, fix confirmed bugs oracle first, and close gaps until bugs or design questions turn up. The first time in a repository, it also onboards the developer: what the session will do, new words explained as they come up, a walk-through, and the choice to finish setting up. Use when someone is trying @tanstack/oracles, asks where an oracle would help, or asks to explore an area ("explore the clearQueue API").'
---

Read `node_modules/@tanstack/oracles/skills/oracles-explore/SKILL.md` in full, and follow it.
It matches the installed version of `@tanstack/oracles`. If that file does not
exist, run the repository's install, then look again. If it is still missing,
`@tanstack/oracles` is not installed there: say so and stop.
9 changes: 9 additions & 0 deletions .claude/skills/oracles-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: oracles-review
description: Review oracle work done with @tanstack/oracles. Challenge whether an oracle enforces its law, whether it is the right law, and whether the work took a shortcut. Use for a new or changed oracle, or a production change in owned code. Also use for a proposed change to what an oracle promises.
---

Read `node_modules/@tanstack/oracles/skills/oracles-review/SKILL.md` in full, and follow it.
It matches the installed version of `@tanstack/oracles`. If that file does not
exist, run the repository's install, then look again. If it is still missing,
`@tanstack/oracles` is not installed there: say so and stop.
9 changes: 9 additions & 0 deletions .claude/skills/oracles-setup/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: oracles-setup
description: Finish setting up a repository for oracles with @tanstack/oracles. Install the latest releases, add the lint preset and the Vitest config, write the agent instructions, make the oracle skills findable by coding agents, and run the oracle through the gap check. Use when the developer wants to keep the work of a first session (a commit, or a pull request), when a repository adopts @tanstack/oracles, or when it upgrades the installed release. Its install and file-placement sections also cover the minimal setup that a first session needs.
---

Read `node_modules/@tanstack/oracles/skills/oracles-setup/SKILL.md` in full, and follow it.
It matches the installed version of `@tanstack/oracles`. If that file does not
exist, run the repository's install, then look again. If it is still missing,
`@tanstack/oracles` is not installed there: say so and stop.
7 changes: 7 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ jobs:
- 'bun.lock'
- 'tsconfig*.json'
- 'vite*.ts'
# The oracles' Vitest config (Test / Unit runs make check-oracles).
- 'vitest.oracle.config.mts'
- 'Makefile'
# The entitlements that Sign / macOS gives the app.
- 'build/**'
Expand Down Expand Up @@ -417,6 +419,11 @@ jobs:
- name: Host proof (own process)
if: matrix.shard == 1 && github.event.inputs.test_filter == ''
run: make test-host-proof
# The oracles (tests/oracles/*.oracle.ts) run under Vitest, not bun test, so the shards
# above never load them. Their laws run once, here; the gap check stays a local tool.
- name: Oracle laws
if: matrix.shard == 1 && github.event.inputs.test_filter == ''
run: make check-oracles
# A shard writes one report per process: coverage/lcov.info for the shared
# process, plus coverage/isolated/<n>/ and coverage/tooling/ (see
# scripts/test-unit-ci.sh). Upload them all.
Expand Down
24 changes: 24 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,30 @@
}
]
}
},
{
"files": [
"**/*oracle*.ts",
"**/*oracle*.tsx",
"**/*oracle*.js",
"**/*oracle*.mjs",
"**/*oracle*.jsx"
],
"jsPlugins": [{ "name": "oracle", "specifier": "@tanstack/eslint-plugin-oracles" }],
"rules": {
"oracle/no-disabled": "error",
"oracle/no-unit-test": "error",
"oracle/oracle-property-only": "error",
"oracle/pure-model": "error",
"oracle/replayable-seed": "error"
}
},
{
"files": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx", "src/**/*.mjs"],
"jsPlugins": [{ "name": "oracle", "specifier": "@tanstack/eslint-plugin-oracles" }],
"rules": {
"oracle/probe-form": "error"
}
}
],
"settings": {
Expand Down
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ include fmt.mk
.PHONY: all build dev start clean help
.PHONY: build-renderer version build-icons build-static build-docker-runtime verify-docker-runtime-artifacts
.PHONY: lint lint-eslint lint-full lint-fix check-oxlint-config check-no-css-zoom typecheck static-check static-check-full
.PHONY: crap crap-check test-crap-scripts tree-sitter-grammars dry-check test-dry-scripts mutate-check test-mutate-scripts
.PHONY: crap crap-check test-crap-scripts tree-sitter-grammars dry-check test-dry-scripts mutate-check test-mutate-scripts test-oracles check-oracles
.PHONY: formal-check
.PHONY: test-bugbash-repros test-bugbash-known-failures bugbash-sandbox-key bugbash-sandbox-image bugbash-sandbox-publish bug-bash-sandbox-recover bug-bash-sandbox-check test-bugbash-repros-sandbox
.PHONY: test test-unit test-unit-ci test-host-proof test-integration test-watch test-coverage test-e2e test-e2e-perf perf-tape-replay smoke-test
Expand Down Expand Up @@ -698,6 +698,23 @@ test-mutate-scripts: tree-sitter-grammars ## Test the mutation runner and mutate
@$(MUTATE_PYTHON) -m pytest -q -p no:cacheprovider scripts/mutate/mutate_report_test.py
@bun test ./scripts/mutate/check.test.ts

# Oracle tests (@tanstack/oracles, tests/oracles/*.oracle.ts): the gap check runs every oracle,
# then mutates the source the oracles own and lists each change no law notices. It is also the
# way agents run the oracles (see "Oracle tests" in AGENTS.md). Add a new oracle's owned source
# to ORACLE_SOURCES (comma-separated). Exit 0 means the check completed, whatever its gaps, and
# even when an oracle fails (it reports the run as provisional), so CI runs check-oracles instead.
ORACLE_SOURCES := src/node/services/memorySecretRedaction.ts
ORACLE_GAPS_ARGS ?= --seed 1

test-oracles: node_modules/.installed ## Run the oracles and their gap check [ORACLE_GAPS_ARGS="--only <id>"]
@node_modules/.bin/oracle-gaps --package . --config vitest.oracle.config.mts \
--source $(ORACLE_SOURCES) $(ORACLE_GAPS_ARGS)

# CI's law check (Test / Unit, shard 1): fails when any oracle's law fails on the unchanged code.
# It judges no gaps, so it is no substitute for test-oracles when you change an oracle.
check-oracles: node_modules/.installed ## Fail when an oracle law fails (CI; agents use test-oracles)
@node_modules/.bin/vitest run --config vitest.oracle.config.mts

formal-check: ## Model-check that a Stop ends the auto-retry loop (TLA+/TLC, Java 11+; see .xum/skills/formal-stop-retry)
@./.xum/skills/formal-stop-retry/check.sh

Expand Down
Loading
Loading