Repository navigation
CAD Complete Source Curve Degree Elevation
Tracked candidate: #1385. Planned; owner freezes exact contract before code and selects ready order.
Planned leaf under #537 SURF-02/#503/#660. Actual #627 is CLOSED for single-span degree1->2 or2->3 selected-only Bezier construction. #631 covers unlike-degree single-span ruled sections only through degree3. #1134/#1353/#1363 preserve degree. All-state degree/elevation/elevate searches found no wider complete-source leaf. Preserve all closed receipts and current #1378/#1373 claims; this is a new capability, not a reinterpretation of their completion.
The first explicit reusable profile admits positive rational single-span Bezier Curves and existing piecewise-C0 Bezier chains, input degree1..4 -> output2..5 by one elevation step. Arbitrary lower-multiplicity B-splines, automatic unlike-degree Loft, smoothness, structural graph nodes and larger capacities remain requirements under #537. They are not silently reduced to this profile.
Reuse or factor the owned homogeneous Bernstein calculation behind #627 with an actual wider-degree provider; the old public constructor cannot admit degree3/4 input. Per span, retain endpoints and compute Hnew[i]=(i/(p+1))*H[i-1]+(1-i/(p+1))*H[i]. For an admitted C0 chain, share original join endpoints and increase each knot multiplicity by one, preserving every original parameter/domain bit. A polynomial algorithm reference is MTU degree elevation notes. Applying it to positive homogeneous rational coefficients is our proposed implementation design; it is not executed numerical evidence or external runtime use.
Freeze exact constructor/validator/types/error names, input/result fields, unsupported-basis admission, immutable parent and paths BEFORE code. Bind the selected full Source0 declaration, IR and native Curve through the actual compiler. Patch exactly four real UTF16 ranges: degree token, knots, control points and weights. Keep complete original/result sources, IDs, Model metadata/order/siblings, every outside byte and unchanged endpoint bits. Reject protected comments inside replaced arrays; never erase them or rebuild a selected-only source.
Keep native Source<=262144 UTF8 bytes and UTF16 units, Model<=16, final<=64 poles and<=70 knots, selected XYZ magnitude<=10000 mm and weights1e-6..1e6. Owner confirms the actual source/kernel bounds against the frozen code. Preflight final dimensions and complete retained result envelope before new work; do not infer a valid source fits a new wrapper. Freeze maximum spans, operations, own-value/array/depth/file bounds and any explicit new result envelope without widening old profiles.
Refuse unsupported lower-multiplicity bases, degree5 input, unsafe/nonfinite homogeneous arithmetic, generated weight/coordinate violations or source/comment/cap conflict. No clamp, normalization, fitting or silent reparameterization. Preserve caller originals/copies and actual causes. Ideal coefficient identity is separate from rounded stored output; actual D0/D1 and C0 refusals are named observations, not a global error, G1/G2 or topology certificate.
CAD owns one new native leaf/private helper only if needed, additive index/README and one fresh cad-nurbs example. Existing parser/compiler/writer/kernel contracts remain unchanged. Primary owns shared leaf integration/exports/final build; helpers are bounded disjoint subtasks of this Issue. Sole Integration owns serial adoption/shared/root/lock. No new package, permanent Work or external CAD kernel.
Use weighted cubic->quartic and quartic->quintic including nonuniform original-parameter C0 spans inside a mixed complete source. Save, cold compile/whole validate, edit a new pole through actual #1134 and repeat elevation only where the declared degree/cap profile permits. Compare complete originals/siblings/IDs/outside ranges and actual local D0/D1, retaining generated rounding. Genuine unsupported-basis, over-cap and representability refusals leave originals intact.
One affected build and short actual source/API/file/cold/emitted-import/type flow, original failures and clean native SHA suffice. General lower-multiplicity elevation and later unlike-degree Loft/graph consumers remain separate tracked follow-ups. CurrentRoot1254/674, broad robustness/performance/reader/packed campaigns and publication are deferred or unauthorized.
Owner freeze: 2026-10-11, before product code. Parent: 8bcb69dce2764566ae38ecfa33e7fd60b29e2398. Checkout: /Users/user/.codex/worktrees/cad2-multispan-section-1201/barocss. Branch: codex/cad2-source-curve-degree-elevation. The parent FIRST build and source Loft flow passed. It was adopted locally at dc133251; current-root consumer checks remain separate. Existing Issue1385 is the functional contract. This leaf does not reduce general lower-multiplicity elevation or unlike-degree Loft requirements under537.
cad_next_scope owns ONLY two new files: packages/barocss-cad/src/source-curve-degree-elevation.ts and PRIVATE packages/barocss-cad/src/curve-c0-degree-elevation-internal.ts. cad_trim_math owns ONLY new examples/cad-nurbs/source-curve-degree-elevation-demo.mjs. Primary owns additive index.ts and README.md, clean commits, FIRST build and ONE new flow. cad_strip_volume performs bounded read-only math/source review and writes external evidence only.
Workers are not alone. Preserve other edits. Helpers run no product API, build, native/runtime, syntax check, tests, commits or remote writes. They create no extra agents. No existing627/helper/core changes, shared root, lock, dependencies, renderer/editor/Loader or other product edits.
Eight public names: elevateSourceCurveDegree, validateSourceCurveDegreeElevation, SourceCurveDegreeElevationError, SourceCurveDegreeElevationDiagnosticCode; types SourceCurveDegreeElevationRequest, Patch, Report, Result.
Request EXACT5: { source, sourceVersion:0, curveId, targetDegree:2|3|4|5, maximumObservations:128 }. Require one step q=p+1. Result EXACT8: { request, source, originalModel, model, originalCurve, curve, provenance, report }. Preserve both complete Models/supports, original source in request and full candidate source. Patch EXACT5 fields: { field, startUTF16, endUTF16, originalText, replacementText }, field degree/knots/control-points/weights. Exactly four patches.
Stable nested coefficient/provenance/report fields and diagnostic vocabulary follow source-plan.md. Whole validator snapshots the exact complete result, rebuilds once from its complete original request, compares all bits and fields, and returns an independent report. It does not run duplicate old/helper validators or trust a cached report. No caller aliases or partial result.
Selected literal native Curve degree1..4. Admit a single Bezier span or an existing piecewise-C0 Bezier chain only. Outer knot blocks have multiplicity p+1. Every interior numeric block has multiplicity EXACT p. Refuse native-valid lower-multiplicity bases, degree5 input or a mismatched target. Do not insert knots to manufacture C0, elevate by multiple degrees, fit, normalize weights, reparameterize or reverse the Curve.
Refuse mixed +/-zero bits within ANY numeric-equal original block, including outer clamps. Preserve every old knot slot in order. Add one duplicate of that block's common represented bit. Original domain and join bits remain exact. No Set zero folding or first-donor normalization of mixed bits.
For S spans, input N=Sp+1. Output N'=S(p+1)+1 and K'=S(p+1)+p+3. Preflight N'<=64 and K'<=70 before any new homogeneous arithmetic, decimal emission or output native construction. Accepted S maxima for input degrees1/2/3/4 are31/21/15/12. Maximum accepted original poles49, generated rows48, copied endpoints/joins32. Native original admission remains64 poles/70 knots; larger valid originals may refuse the output dimension guard. Quadratic21-span reaches actual final64/knots68. Quadratic22-span predicts67/71 while its89 stations still fit128; use it as the genuine pre-helper capacity refusal.
Keep Source262144 UTF16/UTF8, Model16, native weights[1e-6,1e6], selected XYZ±10000mm, all old627 and other profiles unchanged. Require finite positive full domain and every span width. Invalid source/native causes remain actual causes.
Old627 accepts only selected-only single-span1→2 or2→3 and has no trusted wide helper. Leave it unchanged. Add PRIVATE elevateC0BezierChainCoefficientsTrusted(original,blocks) behind the new source leaf. It uses the same owned homogeneous Bernstein association on actual original C0 chunks. It performs no compiler, evaluator, Fraction, source writer, public insertion/extraction or old627 calls. No second NURBS evaluator or external kernel.
Lift each original global Cartesian pole once to H=(wx,wy,wz,w). For each span, copy its two original endpoint Cartesian/weight bits directly. Share each join once in the global output. Generate p interiors with alpha=i/q, beta=1-alpha, leftContribution=alphaHleft, rightContribution=betaHright, Hnew=left+right, point=Hxyz/Hw. Preserve this exact evaluation order. Check finite products/sums/divisions and native generated weight/coordinate bounds. Refuse rather than clamp. Do not add an implicit constant-axis invariant override.
Retain actual lifted original H, each span's original/output global indices, every generated contribution/H/point/weight, unique copied endpoint/join maps, and every copied/new knot slot. Private candidate is real new coefficient data. Root validates it and compiles the full source, then binds the actual compiled Curve to that candidate bit for bit.
Primitive arithmetic counters are omitted. Record actual helper call1, actual span/generated/lifted/copied/added counts. Bound3N+17G<=963 is a mathematical ceiling under per-row alpha/beta computation, not an execution counter. Fixed alpha i/q with q2..5 cannot underflow or round to0/1. Selected coordinate/weight bounds also prevent ordinary H multiplication overflow. Do not fabricate either refusal fixture.
The polynomial formula reference is MTU degree elevation notes, read by primary. Applying it to positive homogeneous rational coefficients is our own implementation design. External notes are not runtime or binary64 acceptance evidence.
Use actual compiler AST/IR/native binding for the selected degree number token and three direct numeric arrays. Match every original scalar/range/lexeme bit. Protected comments inside replaced arrays refuse before arithmetic. Preserve legal comments beside the scalar token and all outside text, Unicode, CRLF, odd spelling, Model metadata/order/IDs and unrelated Curve/Surface objects.
Patch exactly the degree value token and knots/control-points/weights value ranges. Sort, require nonoverlap, apply actual descending UTF16 patches. Every emitted scalar uses the existing decimal emitter and retains represented bits within512 characters. Compile original once and full candidate once. Whole candidate Model equals original except the selected actual elevated Curve. Explicit Curve validation/domain calls are two each; compiler internal work is excluded. No per-span fake source or selected-only original file.
Preflight start/quarter/midpoint/three-quarter/end on EACH original span. Every internal station must be finite, strictly inside and strictly ordered. Shared joins occur once with original block bits. No skipped, nudged or normalized station. m=4S+1<=125 under fixed request128. Direct D0 and D1 attempts are each2m<=250.
Keep actual native C0 refusal states on BOTH supports at every structural join. Do not replace them with inferred derivatives, even if the geometry happens to be smoother. Other native errors refuse honestly. Point difference must be finite and<=1e-7mm. For evaluated D1 pairs, require finite difference/original/output norms and scale before the relative ratio<=1e-7. C0 comparison is null. These are local observations, not a global error certificate.
NEW complete request/result2MiB, BOTH UTF16 and UTF8. Use compact native JSON with literal -0 and exactly one newline. Own1,048,576 values, depth64, array8192, record64, key128, string262144. Count every repeated occurrence, including candidate/helper/Model receipts. Measure original and candidate sources. Settle complete result size metadata with at most8 passes, then final own guard. Source/helper caps do not imply complete result fit. No data removal or silent cap increase. Any refusal leaves caller originals, prior accepted objects and saved files unchanged.
Four required constructions share one new demo command:
- Independently weighted cubic single Bezier, domain[-0,3],4→5poles and degree3→4. Real mixed source with unrelated Curve/Surface, Unicode/CRLF, comments outside changed ranges and unusual scalar spelling. Whole ideal homogeneous proof20 output-degree coefficients; actual rounded stored residuals separate.
- Weighted quartic TWO-span C0 chain, original nonuniform domain[-2,3], join-0,9→11poles and degree4→5. Whole ideal proof48 coefficients; actual fifth-alpha/projected rounding and both native C0 states stay visible.
- Edit an actual generated MAIN quartic pole through actual1134. Then perform the one allowed4→5 step and observe a real changed point. Save/cold validate the full edited source/result. No degree6 attempt or repeated full Fraction campaign.
- Quadratic21-span C0 capacity:43→64poles/68knots. Audit all original/generated/join/knot/source maps and native states. No full MAIN polynomial/public campaign for capacity.
Quartile predictions: station counts5/9/5/85; initial D0/D1 each208, D1 evaluated166/refused42; emissions31/62/37/325, total455. These become claims only after primary execution. Full Fraction work only MAIN+chain:68 whole ideal coefficients. Use bounded demo primitive/GCD/crossproduct counters, every intermediate8192-bit guard,20M primitive operations and integer DTO strings<=5000 characters. Root Fraction count0. Ideal equality, stored binary64 coefficient residuals and native observations remain separate.
Save all full sources, request/result/helper/patch/native/independent data, cold compile complete Models and whole-owned validate. ONE current compiled MAIN constructor/owned replay verifies all eight exports/types and runtime hashes. Source-only bundle/metafile contains this checkout, not dist. Additional source oracle/owned/cold/edit calls are real extra work and are not relabeled lifetime counters.
Genuine negatives include p2S22 output67/71, lower interior multiplicity, degree5/mismatched target, mixed knot block zero bits, protected array comment, finite-span or quarter representability, invalid source/version/ID/fixed budget, changed owned degree/Source/Model/helper/span/generated/join/knot/patch/observation/count/size/quality, getter0/hidden/symbol/sparse/prototype/cycle and previous object/file retention. A proposed p1 domain[0,8e-307] with XYZ endpoints[-50]*3→[50]*3/unitweights can expose finite-component but infinite D1 norm. Preserve the actual reached cause if a native stage refuses earlier; never call it unsafe alpha.
Primary commits the exact five-path clean head with easylogic identity. Run affected CAD library build and ONE node examples/cad-nurbs/source-curve-degree-elevation-demo.mjs --source <fresh output> under Node24/REPO_DEPS_ROOT integration. Preserve FIRST commands/env/logs/exits/partial output/emitted runtime; concrete repairs use a new clean head and distinct output/checkpoint. No old demo, full suite, packed/reader/browser/consumer or standing Review gate.
After native pass, promptly hand exact range/evidence to Integration and Planner. Sole Integration adopts once and immediately reports local SHA. Integrated screen/file/recovery1254/674 and consumers follow later. No product push/PR/npm/deploy/release, new Work/model/schedule. No general lower-multiplicity elevation, automatic unlike-degree Loft, structural graph/editor, Surface/Body/Solid, global error, G1/G2, manufacturing, renderer or publication acceptance. Continue the next ready owned requirement after handoff.
Native receipt. Adoption receipt.
Clean native parent8bcb69dce2764566ae38ecfa33e7fd60b29e2398 to4129877d7364bfed52929ec50f1c3b67e43f9d94 changed exactly five frozen package/example paths. FIRST affected library build and ONE new source/API/file/cold/owned/public flow0/0. No native failure or retry. Integration develop b946e045bdbfbde73986bbf2fdad0440b69e26ed has the three new public/private/demo blobs exactly and the complete additive index/README groups in current composition. Private helper is absent from the public barrel; old627 and prior APIs stay unchanged.
The new complete-source one-step degree1..4 elevation admits a single Bezier or existing exact-C0 chain. It preflights final64/70 dimensions and complete quartile stations before new H arithmetic, then uses real original-global homogeneous Bernstein coefficients with directly copied endpoints/shared joins. All original knot slots remain; each block gets one new common-bit duplicate. Four actual AST value patches preserve all outside source, Model metadata/order/IDs and unrelated geometry. Mixed zero blocks and lower-multiplicity bases refuse; no fitting, normalization or hidden refinement.
Four constructions pass: weighted cubic3→4/poles4→5; nonuniform quartic two-span C0→quintic/poles9→11; actual1134 generated MAIN pole1 edit then allowed4→5/poles5→6; quadratic21-span capacity43→64/knots68. Initial104 stations/208D0/208D1 (166evaluated/42actualC0refused),455 decimal emissions. Ideal68 homogeneous coefficient identity and actual stored rounding remain separate. Demo256,558primitive operations under20M;8192bits/5000DTO are limits, not observed maxima. RootFraction0, no fictitious primitive counter. Both actual finite-component derivative norms genuinely reach REPRESENTABILITY in the norm guard; fixed coefficient alpha has no fabricated unsafe-alpha witness.
39 genuine refusals include17 nonnoopOwned/getter0/atomic prior object+file retention, quadratic22-span validoriginal→predicted67/71 pre-helper capacity refusal, protected comments, degree/basis/zero/version/ID/own data and finite-span controls. Initial message manual38 count was corrected once; published native receipt/JSON already recorded39. ONE current compiled MAIN constructor/owned replay verifies8JS/types.50 output artifacts/189CADsourceinputs/380emittedJS+d.ts hashes/fullruntime. Largest complete request2242/result85249UTF8bytes under new2MiB envelope; all original/candidate sources/Models/helper receipts retained. Evidence: /Users/user/.barocss-ai/v3/evidence-source-curve-degree-elevation-cad2/native-handoff.json and output-manifest.json.
Status: merged; integration validation pending. Current Root/consumer/screen/file/recovery1254/674 are unrun. Native and verified local-adoption notice tools accepted once to Integration and Planner; read/consumer notification are separate. No general lower-multiplicity elevation, automatic unlike-degree Loft, structural graph, global error/G1G2/Body/Solid/manufacturing/publication acceptance.
Next owned requirement: existing #533 shared structural knot-recipe graph. Fresh all-state audit found existing tracking comments and related closed scalar graph/alignment/reader/editor scopes; no executable matching shared-recipe leaf. Three source/flow/math plans check public1316/1353/1139 reuse and full validation-versus-selective work. No new graph Issue/code/pass is claimed yet.