Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

13.9 KB
Raw Blame

Integration checks

These library APIs run in the destination project's TypeScript toolchain, not inside generated .kiln.js source. Use the project's installed Kiln package; do not copy engine implementation into the asset workspace.

inspectGlbIntegration(bytes) from @instruktlabs/kiln/render reads the actual GLB and returns an integration manifest or undefined when no usable scene bounds exist. Check that result before using bounds, axes, ground correction, structural findings, or artifact hash.

Kiln authors metres, +X forward, +Y up, +Z right. Confirm importer conversion in the destination. Ground correction must be applied in the frame it describes, especially under rotated/scaled parents. Bounds alone cannot prove that feet, wheels, or collision geometry make the intended contact.

Optional SDK use

Library checks are optional; CLI/MCP-only QA never needs them. A generated workspace has no package.json, so a script importing @instruktlabs/kiln/render fails with ERR_MODULE_NOT_FOUND until the package is installed where the script runs: npm install @instruktlabs/kiln@<version>, pinned to the Kiln runtime in use. Take the version from kiln --version when it exists, the MCP server's serverInfo.version, or the version in the package.json beside the dist/ folder holding the dist/mcp-server.mjs the MCP config names; npm ls @instruktlabs/kiln shows an existing install. Import only documented public subpaths, never guessed dist/ or lib/ files.

Host-declared checks

Before authoring, read kiln_discover({ capabilities: true }). When requirements.declared.validationProfile is present, the host has bound destination checks, such as primitive counts, required attributes, an attribute gradient along a local axis, or material alpha mode and sidedness, for the nodes its patterns name. Patterns match final GLB node names; createPart('frond_0') exports Mesh_frond_0. The rule HOST_VALIDATION_PROFILE checks the final GLB on every kiln_render and kiln_save. In enforce mode its findings block, and each names the check, assertion and node path. Meet the check in the asset; renaming nodes so nothing matches is reported as HOST_VALIDATION_SELECTOR_UNMATCHED. Tool arguments and source metadata cannot change the profile. Without a declared profile these checks do not exist; do not apply another destination's checks to a standalone asset.

A destination audit that reads geometry can run before a save: kiln_export with a programRef returns a resource for the bytes kiln_save would persist and writes nothing, and the CLI's render REF --out x.glb reaches the same bytes. A part summary cannot stand in for them, because one merged mesh reports as one box whatever it contains.

Modules composed in a project

An asset's own QA cannot see a neighbour. When modules saved separately stand together, measure them together: give each inventory item a placement ({} states the shared origin; a missing placement means not composed, never identity), then run node kiln.mjs project check ID --revision REVISION or kiln_project { action: "check", projectId }. Each kiln_save of a placed asset under its bound project also returns this as composition, measuring the revision being saved against the pinned neighbours, and records it in the build record.

Read coverage before the findings: only complete means everything in scope was measured. partial names what was not, and an item in unmeasured is not certified clear. overlaps and openSurfaces name the module and part on each side with volume or depth. A positive is a measurement rather than a verdict: a fitting socketed into a neighbour's shell is reported as a bolt in a hole is. A draft is not measured until it is saved, and a standalone asset gets no report. Do not create a project or a placement to obtain one for an asset that stands alone.

What to measure

Question Evidence
Did the intended file load? Resolved asset path, parsed GLB, content hash/manifest
Does its size and orientation fit? Scene comparison, importer transform, world-space bounds
Are materials correct? Destination lighting and texture review; material-faithful Kiln view where available
Does it move correctly? Named clip, intermediate poses, transitions, attachments and relevant controls
Can it be used in the scene? Collision, reachability, interactions and contact under real placement
What does it cost? Loading, geometry, draw calls, textures and representative-device measurements

Source refs name source revisions. They do not identify arbitrary externally modified GLB bytes. Track the exact exported file used for integration.

For a first-person presentation, review the held assembly from its actual animated eye frame at the destination field of view and aspect ratio. Inspect ready, lift, contact and recovery; an external pose can fit both hands while obscuring the crosshair or passing through the camera. Keep any view-specific presentation in the asset or consuming scene selected by the brief, not in universal rig defaults.

Measure deformed surface vertices as well as contact locators. Planted foot markers do not rule out a sole, claw or swinging hand passing below the ground. Sample between animation keys and between the usual quarter poses; record the sampling density and tolerance rather than claiming a continuous guarantee from a few views.

For atlas cutouts, first inspect the exact saved sheet on light, dark and checker backgrounds for alpha, edge RGB and region placement. Raw map pixels establish image content, not shaded material appearance. Then inspect the exported asset with the destination's actual sampler, alpha cutoff, sidedness and lighting, including receding and moving views. A still nearest-filtered preview cannot clear mip bleed, shimmering or disappearing thin details. Keep material revision, atlas region and compiler identity with the reviewed file. Structural UV-domain checks cannot prove intended corner orientation without source correspondence; use an asymmetric corner fixture when qualifying a mapping pipeline.

composeSceneGLB defaults to static composition (keepAnimations: false). Explicitly keep animations when required. Its material optimization policy can change scene material organization; choose it deliberately, then inspect the result. Warnings can report skipped inputs, so successful export alone does not prove every required asset was included.

Establish who drives motion in the destination. A consumer that procedurally rotates rigid child joints may require a static rest-pose GLB and reject embedded clips or skins, even when an animated QA study looks correct. In that case, keep the canonical source and motion study, and deliver a separately identified static artifact with the required named pivots, hierarchy and local transforms intact. Verify the final file's clip/skin inventory and exact node bindings; do not flatten the rig merely to pass import. Selecting the runtime delivery profile does not remove native glTF animation. This is conditional on the consumer contract, not a static-only default for asset authoring.

Do not invent a universal performance cap. State the destination, tested conditions, and material limits of the evidence.

Functional fit

Kiln's own structural checks — the floating-parts warning and the part-connectivity observation — read the bounding boxes of drawn meshes with a 2 cm adjacency tolerance. They report a part or subassembly detached from the body; they are not a fit audit. A mesh holding several welded components is compared once per component, so a primitive merged into another is seen, but the same limits bound what a clean pass means. A separation under the tolerance reads as contact, so a part standing a millimetre or two off its host is not reported. Boxes are not surfaces: components of a diagonal or wrapped shape can read as touching when they are not. And foliage and decal names, instanced and skinned meshes, LOD alternates and meshes over the split budget stay one box. Where millimetre contact is a requirement, measure it in the destination against the exported file, and run that audit before saving the revision rather than after.

A welded finding can also reveal more than the mesh it names. A merged mesh spread across an asset used to be one large box that touched everything near it, so splitting one can report other parts as detached for the first time. That is the box no longer bridging them, not a change in the geometry.

For an enterable building or gate, test the intended actor through the exported opening with collision enabled. Include thresholds, plinths, lintels, trim and hinge travel. The open leaf and nominal wall dimensions do not prove passage. Check the closed state blocks where intended, the opening sweep clears its surroundings, and the open state admits the actor. Repair obstructing asset geometry at its source rather than disabling the building's collision to pass.

For an operator and machine, inspect the actual seated pose with the controls at their relevant extremes. A seat socket proves an attachment transform, not body clearance or reach. Distinguish a demo controller's pose from clips included in the asset download. Limb joints need intermediate-pose views as well as endpoint closure; flush rest-pose joins can separate or expose caps during motion.

For articulated actors carrying equipment, inspect the limb bend as well as hand attachment closure. A hand can reach its target while the elbow folds through the body. Include headgear and carried items in intermediate-pose clearance checks. Verify palm/finger orientation and wrist continuity against the full handle. Sample the interpolated skinned surfaces as well as joint centres; shoulder weights can create a pointed cap or a sleeve crossing the torso despite valid attachment distances. Inspect the actual first-person view when the destination requires it, without treating camera offsets as a repair for an invalid grip. Also inspect cables or strings at their moving attachment points. A convincing draw or tensioning action needs compatible equipment deformation, not just a moving hand and an arbitrarily stretched connector. Keep controller choices and equipment fit in the destination; a scene repair need not change the saved master.

For a payload transfer, test the actual payload against the full gripper housing, jaws and carrier, including pin/groove alignment and opening clearance. Matching attachment transforms or contact at the endpoints does not establish a valid transfer. Sample the approach and release paths with the destination's actual interpolation, changing attachment ownership at the intended handoff. Check for penetration and visible jumps immediately before and after that change. Record the sample spacing and clearance tolerance; discrete samples alone do not prove a continuous collision-free sweep. Keep controller logic and scenario dimensions in the destination workspace, then recheck the exact repaired asset revision.

After batching, compression or other optimization, verify named moving nodes, attachment transforms, clips and material appearance again. Treat the optimized file as a derivative with its own hash and keep the editable source and baseline.

Performance evidence

In builds that provide it, drawDiagnostics appears in kiln_inspect compact/full results, kiln_export, kiln_export_to receipts, and CLI export JSON for GLBs/bundles. It is advisory output, not a QA rule or acceptance result. Read status and reason first: input-limit, unreadable-glb or analysis-failed means no assessment. An absent field in an older installation or a lean response is not a clean result.

Read scope and mergeEstimate.method with the numbers. These are static single-pass primitive counts across document scenes with node visibility, without culling, alternate LOD selections, shadows, reflections, depth or other renderer passes. The estimate uses current materials and the rigid merge's layouts, boundaries, locks, byte budget and vertex splits; it excludes palette consolidation and instancing, so it does not predict complete full output or GPU speed. Check mergeEstimate.skipped and rejected buckets. Compare per-anchor draws and afterRigidMerge by ID, and report anchors.omitted when the listing is truncated. Measure actual destination draws by anchor, material and pass after export, then exercise the interactions and attachments those anchors protect.

For a composed scene, inventory every placed asset family and conditional visible state, then verify actual submitted draws from representative views. Report pack-only assets separately. A source primitive count is not a visible draw count; one mesh may have several material groups, and repeated geometry may be instanced into spatial batches. Compare skin counts and material/texture variants when a low-triangle asset still contributes many submissions. Separate coverage snapshots from timed benchmarks and preserve exact camera, viewport and quality settings when comparing runtime derivatives.

Read each observation's evidence and sampling/omission counts. mirroredTangents identifies static tangent-bearing parts with mirrored transforms; it does not establish a shading defect. coplanarParts samples triangle overlaps between parts; it neither proves visible z-fighting nor clears unsampled faces. Skinned, morphed and GPU-instanced uses are unexamined by these observations. Review candidate surfaces and normal-map lighting in the destination before changing geometry or material behavior.

Separate cold loading/compilation and first interactions from warmed playback. Record actual renderer/backend, versions, resolution, quality and representative instances. Distinguish CPU submission/update time, browser frame intervals and GPU query time. GPU queries must identify fresh samples; unsupported, stale, disjoint or failed queries are unavailable, not zero or substituted CPU time. These measurements do not establish displayed-frame latency. Concurrent work on the machine makes acceptance data suspect even if a small functional test passes.