Programming Language

Nocter

A self-contained systems language built around simplicity, encapsulation, and foolproof design.

/development/reviews/v0.14.0-boundary-inventory.md

v0.14.0 Boundary Inventory

Status: complete and confirmed by the adversarial second review (2026-08-23).

This inventory records the production contracts reviewed before v0.14.0 release preparation. A dependency is justified only by the named contract. Test-only composition is listed separately because it must not silently become a production dependency.

Vertical Compiler Pipeline

OwnerResponsibilityInput contractsOutput contractsInvariants and forbidden knowledgeProduction consumers
nocter-sourceNormalize source bytes and own byte/line/UTF-16 coordinatesNames and bytesSourceMap, SourceFile, Span, TextRange, coordinate conversionsA range belongs to one source and is boundary-valid; no syntax or semanticssyntax, package, discovery, diagnostics, projection, tooling
nocter-syntaxPreserve every token while recognizing one parse goalSourceFileSyntaxTree, tokens, nodes, lexical and parse diagnosticsNode/token identity belongs to exactly one tree; no filesystem, package, or semantic identitypackage, discovery, compile input, lowering, checking, source tooling, analysis
nocter-compile-inputFreeze discovery-selected topology and syntax borrowssource, syntax, model identities, declaration role vocabularyCompileUnitInput and exact module/use/toolchain inputsNo filesystem probing or semantic decisions; consumers must not reopen pathsdeclaration lowering, checking, discovery, session
nocter-declaration-loweringConvert syntax declarations and imports into syntax-independent semantic declarationsCompileUnitInput, target selectionDeclarationProgram, SourceIndex, typed lowering failuresCreates each semantic identity once; no body semantics or filesystem lookupchecking, session
nocter-declarationsOwn immutable declaration graph and declaration-level contractsmodel identities and structural typesDeclarationProgram, DeclarationGraph, declaration algebrasNo source, syntax, rendered spelling reconstruction, or body decisionslowering, checking, target program, analysis
nocter-checkingResolve names and build typed bodies, ownership, provenance, conformance, and dispatch factscompile input, declaration graph, source projection for diagnosticsCheckedProgram, recovery snapshots, checked failuresOnly phase after lowering allowed to inspect body syntax; later phases may not repeat checkingsession, target program, analysis, MIR
nocter-target-programGrant implemented target capability, validate the standard primitive contract, and close one monomorphized executablechecked semantics, target/toolchain capability, semantic primitive bindingsTargetProgram, ExecutableProgram, executable roots and specialized representationsNo source/syntax dependency; every executable dependency is selected before MIRsession, MIR
nocter-mirLower executable semantics into validated typed CFG and cleanup operationsExecutableProgram and deliberate checked/declaration contracts needed by validationMirProgram, MIR functions and rootsNo source, unresolved dispatch, presentation spelling, ABI layout, or machine statesession, machine
nocter-machineSelect target-independent layout, ABI transport, linkage, destruction, and machine operationsValidated MIR plus a closed runtime/type-representation contractMachineProgramMust not inspect target-program, checked program, source graph, symbols, or declaration construction statesession, ARM64
nocter-arm64Select and encode physical ARM64 instructionsMachineProgramArm64ProgramNo MIR, semantic, source, package, or executable-program dependencysession, Mach-O
nocter-machoSerialize a complete ARM64 Mach-O imageArm64Program, deterministic hashMachOImageOwns file layout, commands, offsets, signature, and bytes; no compiler phase reconstructionsession, command

Source, Diagnostic, and Tooling Contracts

OwnerResponsibilityInput contractsOutput contractsInvariants and forbidden knowledgeProduction consumers
nocter-source-indexPair semantic identities with exact syntax/source originsmodel identities, source, syntaxSourceIndex, SemanticEntity, documentation and occurrence bindingsSole semantic/source pairing authority; semantic programs never depend on itlowering, checking output, diagnostics, session, analysis, command
nocter-diagnosticsCarry and render phase-selected source diagnosticssource and source-index origins, syntax failures, JSON writerSourceDiagnostic, human/JSON projectionsDoes not decide semantic rules; a phase owns the diagnostic meaningCLI, command, discovery, lowering, checking, analysis, source tooling
nocter-source-toolingInspect and format one normalized source without compilationsource, syntax, diagnosticsformatter and token projectionsNo package discovery, semantic resolution, or target selectioncommand
nocter-analysisRetain one immutable generation and answer protocol-independent semantic queriesdiscovery snapshot/failure, compiler session output/recovery, source projectionAnalysisSnapshot, semantic presentations, edits, locations, highlights, completionsNever substitutes stale success; no URI/JSON-RPC or filesystem scope selectionlanguage server
nocter-lspDecode, validate, and encode JSON-RPC/LSP protocol valuesbounded JSONvalidated request/notification values and response encodersNo filesystem or compiler semanticsCLI, language server
nocter-language-serverMap protocol documents to canonical paths, select analysis scope, and project compiler queries to LSPLSP values, filesystem source views, package/discovery/session configuration, analysis contractsaccepted workspace generations and LSP responsesURI/path state and protocol coordinates only; semantic answers remain analysis-ownedCLI

Package, Filesystem, and Process Contracts

OwnerResponsibilityInput contractsOutput contractsInvariants and forbidden knowledgeProduction consumers
nocter-filesystemSelect immutable source bytes ahead of disk for one generationcanonical paths, byte snapshots, optional editor metadataread-only source viewNo package mutation, fetching, locking, syntax, or semanticspackage, discovery, analysis, language server
nocter-packageDecode nocter.nct and resolve an exact read-only package graphsource view, syntax, package identities, deterministic hashpackage declaration, exact graph, lock update proposal, typed requirementsSole directive decoder; no network or persistent mutationinstallation, discovery, package state, acquisition, command, language server
nocter-package-acquisitionAcquire exact remote content into caller-owned staging pathspackage-state authority requests and exact source/lock contractsstaged Git/archive package or typed transport/policy failureNo graph validation, publication, or lock commitCLI through package-state authority
nocter-package-stateCoordinate generated locks, staging, validation, exact-store publication, and manifest commitread-only package resolver and injected acquisition authorityresolved selection with semantically committed root locksMutation stays transaction-owned; acquisition cannot publish directlycommand
nocter-discoveryProbe selected package roots and freeze the exact source/module/use graphresolved package graph, source view, syntax, target selection, toolchain locatorsDiscoveredUnit, reached-source failureSole module/path probing authority; later phases never reopen importssession, command, analysis, language server
nocter-installationSelect and validate one Nocter home and bundled toolchain installationprocess-supplied path request, installation manifest, package identityCompilerInstallation, StandardPackageNo process-global reads, argument parsing, user graph resolution, or compilationCLI
nocter-sessionCompose one closed compiler or native-output rundiscovered unit and explicit executable/test selectioncompiled target/executable/native image with independent source projectionNo repeated lower-phase decisions; no filesystem persistence or process launchcommand, analysis, language server
nocter-commandParse command grammar and orchestrate source initialization, read-only graph inspection, package state, compilation, artifacts, and child processespackage/session/source-tooling contracts and complete Mach-O imagescommand result/presentation values and bounded filesystem/process effectsDoes not assemble compiler stages or reopen target/source identity; graph inspection has no mutation authorityCLI
nocter-cliRead process facts once and adapt public process I/Oinstallation, command, language-server and diagnostic contractsprocess exit status/stdout/stderr behaviorNo argument grammar, package interpretation, semantic rule, or backend decisionexecutable entry point

Shared and Supporting Contracts

OwnerResponsibilityInput contractsOutput contractsInvariants and forbidden knowledgeProduction consumers
nocter-modelOwn dependency-free semantic identity domains and structural type interningprimitive Rust valuesIDs, arenas, symbols, TypeStore, target/package identitiesNo source, syntax, filesystem, or phase implementationsemantic and backend crates
nocter-runtime-contractOwn source-independent identities and representations shared across the target, MIR, and machine boundarymodel identities and structural typesprimitive-role registry, runtime type representations, runtime ABI identityNo source paths, syntax tokens, declaration spellings, target-program storage, or machine policycompile input, lowering, discovery, session, target program, MIR, machine, ARM64
nocter-target-selectionDecide syntax-item activity for one compilation targetsource, syntax, recognized targetimmutable TargetSelectionNo package resolution or semantic loweringdiscovery, declaration lowering
nocter-jsonParse and render bounded deterministic JSONUTF-8 text/value inputsJSON value and writer contractsBounded nesting; no protocol or diagnostic semanticsLSP, diagnostics, installation, language server
nocter-hashProvide dependency-free deterministic hashingbytesstable digestNo package or image policypackage, acquisition, Mach-O

Test-only Responsibilities

OwnerResponsibilityAllowed inputsRequired evidenceForbidden substitution
nocter-test-supportBuild compact synthetic compile units for lower-boundary testspublic compile-input/lowering/declaration contractsIndividual phase invariantsIt cannot replace production discovery/session/example conformance
nocter-conformanceExercise cross-crate compiler and native behaviorpublic production facades and explicit fixturesobservable diagnostics, native output, determinism, and boundary rejectionIt cannot assert only internal arena shapes
development/stdExercise the language through ordinary authored standard APIspublic language constructs plus explicitly selected primitivesbuild/run tests and standard-role contract validationCompiler built-ins cannot replace source-expressible APIs
examplesDemonstrate released user workflowspublic CLI and language surfacecomplete build/run qualificationInvalid diagnostic fixtures and repository-only setup stay outside examples

Dependency Conclusions

The first pass identified the following unjustified production edges:

  • nocter-checking -> nocter-declaration-lowering for compile-input types re-exported by lowering;
  • nocter-target-program -> nocter-compile-input and nocter-target-program -> nocter-source-index for syntax-token-to-semantic primitive binding;
  • nocter-machine -> nocter-target-program for ABI identity, primitive role, executable type representation, and one test-name reach-through;
  • the semantic misuse inside nocter-filesystem whereby a compiler byte override must pretend to be a versioned open editor document.

All four unjustified dependency edges have been removed. nocter-machine now receives the closed MIR program and canonical runtime contracts only; nocter-target-program remains a dev-dependency there solely for integration fixtures. MIR obtains checked semantic facts through explicit executable queries and consumes the executable into a closed runtime environment; executable, target, and checked storage cannot be navigated by backend production code.

The remaining direct edges name deliberate input/output contracts. Some contracts are broad, but a broad contract is not itself a finding unless a consumer relies on a provider's storage nesting or reconstructs an omitted decision.