mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-17 06:00:56 +00:00
916b91e8d0
solidcore's main at c0d3cc0124, rewritten to one commit per same-author run per PR (2,800 commits, author credit kept; tree identical). Full original history: tangency-labs/solidcore archive/full-history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> git-subtree-dir: solidcore git-subtree-mainline:44525da669git-subtree-split:c440e5f892
138 lines
9.0 KiB
YAML
Vendored
138 lines
9.0 KiB
YAML
Vendored
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
|
|
# CodeRabbit for solidcore: what reviews should look for, beyond correctness. The rules are
|
|
# AGENTS.md's and the reference docs'; these instructions point at them, they do not replace them.
|
|
reviews:
|
|
path_instructions:
|
|
- path: "**"
|
|
instructions: |
|
|
Review for design quality as well as correctness. solidcore's rules are in AGENTS.md;
|
|
read the reference doc for the area a change touches before judging it.
|
|
|
|
- Flag code smells: logic duplicated from elsewhere in the kernel, special cases
|
|
bolted onto a general routine, tolerances or constants with no derivation, flags
|
|
or switches that keep an old path alive, fallbacks that hide a failure, and error
|
|
paths that lose the reason.
|
|
- Flag patches that make a symptom go away without fixing its cause: a widened
|
|
tolerance, a retry, an early return that skips the hard case, a test changed to
|
|
match new output. Ask what the root cause is and whether the change removes it.
|
|
- When a change reads like a patch, look at the other open pull requests and recent
|
|
changes in the same area. If several fixes keep touching the same code, say so,
|
|
and ask for the bigger picture: the shared cause, and the design that removes it.
|
|
- It is fine to recommend stopping and narrowing the scope. A smaller change that is
|
|
right, or an issue that states the real problem, is better than a larger change
|
|
that adds code which will have to be undone. Say so when that is the better path.
|
|
- Each fix needs a test that fails without it, and tests should check values a
|
|
wrong result would change. Tests gate on counts and values, never on timings.
|
|
|
|
The contract every construction keeps (docs/definitions-and-certificates.md):
|
|
- A face's surface is its definition S; its B-spline net B is an exact copy or a
|
|
certified approximation within a stored, proved epsilon. Every face of a result is
|
|
exact or certified. An operation that cannot build that refuses with a typed error
|
|
naming its cause and, where one exists, the size that builds. A correct refusal is a
|
|
correct result; a body built on a bare fitted face, an estimated bound or a widened
|
|
tolerance is not.
|
|
- A final answer (an intersection, a projection, a check, a continuity grade) reads S,
|
|
or B only inside a `NetScope` that asks for at least epsilon. A bound is enclosed,
|
|
never sampled or estimated, and rounding is counted.
|
|
- Layers (docs/layers.md): the kernel computes; ops decides and sequences and never
|
|
computes a geometric quantity; the applications compute nothing.
|
|
- No compatibility flags: a fix changes the default result, listing the cases it moves
|
|
and why each is right; no new `UpstreamFixes` field, no old path kept behind a switch.
|
|
- Show the problem first (AGENTS.md): a change to a case's result shows it before and
|
|
after from the same view, a VectorCraft schematic where the problem is a mechanism,
|
|
and the literature it follows. Ask for them when they are missing.
|
|
- Library code: no `unwrap`, `expect`, `panic!` or unchecked indexing; deterministic
|
|
results; input-dependent recursion bounded. Licence: only the upstream paths AGENTS.md
|
|
lists; never GPL/LGPL code.
|
|
|
|
- path: "crates/solidcore/src/blend/**"
|
|
instructions: |
|
|
Fillets, chamfers, corners and setbacks: docs/generic-blend.md. They are one rolling-ball
|
|
construction (spine, rails, section, ends, corners, fold check, overflow); a failing case
|
|
means one of those parts is wrong for it, never a reason for a special case. Each blend
|
|
face carries its definition (`procedural_blend()`), or has an entry in the definition
|
|
ledger (crates/solidcore/tests/data/blend_definition_ledger/) and a test asserting which.
|
|
Cases are events decided from the geometry (a tangent end, a knife edge, a fold, a corner
|
|
type), not one construction tried and then the next. A round never ends at a seam's vertex
|
|
with a step: a picked edge continues across a seam into the rest of the same curve between
|
|
the same two faces, or the blend refuses. A size that does not fit is refused naming the
|
|
size that does.
|
|
|
|
- path: "crates/solidcore/src/boolean/**"
|
|
instructions: |
|
|
Booleans: docs/booleans.md. The result is the regularized set operation decided on the
|
|
exact surfaces, or a typed refusal. Every decision point (a ray hit, a step-off point, an
|
|
imprinted vertex) is a root on S; no step reads a display mesh. A face set takes its class
|
|
(inside, outside, on) from a sector at a common edge, a ray or a coincident pair, and
|
|
nothing is kept or dropped for any other reason. A trimmed or copied face keeps its
|
|
surface's definition. Angle cut-offs and sampled coincidence are open work in the doc;
|
|
flag new ones standing in for a proof.
|
|
|
|
- path: "crates/solidcore/src/offset/**"
|
|
instructions: |
|
|
Offset, shell and thicken: docs/offset-and-shell.md. A face's offset is the offset of its
|
|
definition S, never of its net B: exact for the analytic kinds, certified otherwise. Where
|
|
the distance reaches the least radius of curvature on the displaced side (towards the
|
|
centre of curvature) the offset collapses or folds; that is refused naming the largest
|
|
wall that builds, never built and repaired. A wall on the other side never folds from
|
|
curvature alone. The offset body's tolerance
|
|
is the input body's. The five-stage construction (face offsets, mitres with the extension
|
|
reach, arrangement, winding-number cavity rule, extraction) is the design; flag work that
|
|
extends the old executive instead of it.
|
|
|
|
- path: "crates/solidcore/src/sweep/**"
|
|
instructions: |
|
|
Swept surfaces and threads: docs/procedural-sweep.md. A sweep is its definition (profile,
|
|
path, frame); its net is exact where the doc says so and certified otherwise. Check a
|
|
change against the doc's invariants and its exact-net cases.
|
|
|
|
- path: "crates/solidcore/src/intersect/**"
|
|
instructions: &ssi |
|
|
Surface/surface intersection: docs/ssi.md. Curves come from closed forms where they exist
|
|
(line, circle, ellipse) and are traced otherwise; tangent contacts and branch points are
|
|
events with their own handling, not a retry with a smaller step. Every reported point is a
|
|
root on both definitions within its stated tolerance.
|
|
- path: "crates/ssi/**"
|
|
instructions: *ssi
|
|
- path: "crates/solidcore-ssi/**"
|
|
instructions: *ssi
|
|
|
|
- path: "crates/solidcore/src/topology/**"
|
|
instructions: &validity |
|
|
B-rep validity, tolerances and healing: docs/validity-and-tolerances.md. A tolerance may
|
|
grow only to a bound: for imported data, to an enclosed (not sampled) gap, recorded; for a
|
|
construction, to its certificates' delta + max epsilon. A measured gap larger than that
|
|
means the construction is wrong: refuse, or recompute the curve from its surfaces'
|
|
intersection. No tube or ball may reach an entity it does not bound. A seam is an edge; a
|
|
face crossing its surface's seam carries it.
|
|
- path: "crates/solidcore/src/heal/**"
|
|
instructions: *validity
|
|
|
|
- path: "crates/solidcore-tess/**"
|
|
instructions: |
|
|
Tessellation is for display and export only (docs/layers.md): it decides nothing about the
|
|
model. Flag any model decision made from a mesh.
|
|
|
|
- path: "crates/solidcore-ops/**"
|
|
instructions: |
|
|
Ops is the modelling API (docs/layers.md): it chooses entities, parameters and defaults and
|
|
sequences kernel calls; it never computes a geometric quantity itself (distances,
|
|
curvatures, intersections, fits). Results go through `finish`, which refuses a body that is
|
|
not a valid outward solid where a solid was asked for.
|
|
|
|
- path: "docs/**"
|
|
instructions: |
|
|
A doc points to code, tests, records and the literature, never to a pull request or an
|
|
issue: no `#NNNN` and no PR or issue links, so a page reads the same whatever happens to the
|
|
tracker. A new page under docs/ needs the maintainers' agreement on its issue; one the
|
|
maintainers asked for in the pull request is fine. Figures are drawn in VectorCraft with
|
|
live text, their `.vectorcraft` source beside them, palette in docs/agent-style.md.
|
|
|
|
- path: "crates/solidcore/tests/kernel_cases/**"
|
|
instructions: |
|
|
A kernel case's outcome changes in the case itself: its JSON expectation (and its
|
|
`gallery_note` if needed), its line in `known_failing.json` and its render beside it, never
|
|
a doc (the site's case gallery is generated from them). An expectation is graded on closed
|
|
forms or invariants of the geometry, not on another kernel's measured result; a refusal is
|
|
graded on the size it names.
|