From 271029d0fd24a39b79dde5237498e314d3194270 Mon Sep 17 00:00:00 2001 From: vvardan007 <141992422+vvardan007@users.noreply.github.com> Date: Mon, 30 Nov 2026 23:19:27 +0530 Subject: [PATCH 1/2] Remove completed extension-bindings planning documents Delete the phase 1 to 6 records, the Phase 3 checklist, the rc CLI proposal, the original implementation standard and the future-work notes from tooling/extension-bindings/. The work they describe is done or has moved to issues, and they stay available in git history. Reword the three README sentences that named IMPLEMENTATION.md or called it protected, keeping the decisions they record. Drop the two path filters for IMPLEMENTATION.md from extension-binding-normalizer.yml. Closes #89 --- .../extension-binding-normalizer.yml | 2 - tooling/extension-bindings/CLI-PLANNING.md | 238 ---- tooling/extension-bindings/FUTURE_WORK.md | 92 -- tooling/extension-bindings/IMPLEMENTATION.md | 1255 ----------------- tooling/extension-bindings/PHASE-1.md | 97 -- tooling/extension-bindings/PHASE-2.md | 53 - tooling/extension-bindings/PHASE-3-TODO.md | 146 -- tooling/extension-bindings/PHASE-3.md | 43 - tooling/extension-bindings/PHASE-4.md | 127 -- tooling/extension-bindings/Phase-4-final.md | 736 ---------- tooling/extension-bindings/Phase-5.md | 129 -- tooling/extension-bindings/Phase-6.md | 47 - tooling/extension-bindings/README.md | 13 +- 13 files changed, 7 insertions(+), 2971 deletions(-) delete mode 100644 tooling/extension-bindings/CLI-PLANNING.md delete mode 100644 tooling/extension-bindings/FUTURE_WORK.md delete mode 100644 tooling/extension-bindings/IMPLEMENTATION.md delete mode 100644 tooling/extension-bindings/PHASE-1.md delete mode 100644 tooling/extension-bindings/PHASE-2.md delete mode 100644 tooling/extension-bindings/PHASE-3-TODO.md delete mode 100644 tooling/extension-bindings/PHASE-3.md delete mode 100644 tooling/extension-bindings/PHASE-4.md delete mode 100644 tooling/extension-bindings/Phase-4-final.md delete mode 100644 tooling/extension-bindings/Phase-5.md delete mode 100644 tooling/extension-bindings/Phase-6.md diff --git a/.github/workflows/extension-binding-normalizer.yml b/.github/workflows/extension-binding-normalizer.yml index a17c05a..07bcc0c 100644 --- a/.github/workflows/extension-binding-normalizer.yml +++ b/.github/workflows/extension-binding-normalizer.yml @@ -5,7 +5,6 @@ on: paths: - ".github/workflows/extension-binding-normalizer.yml" - "catalog/**" - - "tooling/extension-bindings/IMPLEMENTATION.md" - "tooling/extension-bindings/README.md" - "tooling/extension-bindings/emitters/go/**" - "tooling/extension-bindings/emitters/java/**" @@ -17,7 +16,6 @@ on: paths: - ".github/workflows/extension-binding-normalizer.yml" - "catalog/**" - - "tooling/extension-bindings/IMPLEMENTATION.md" - "tooling/extension-bindings/README.md" - "tooling/extension-bindings/emitters/go/**" - "tooling/extension-bindings/emitters/java/**" diff --git a/tooling/extension-bindings/CLI-PLANNING.md b/tooling/extension-bindings/CLI-PLANNING.md deleted file mode 100644 index 33c9fdc..0000000 --- a/tooling/extension-bindings/CLI-PLANNING.md +++ /dev/null @@ -1,238 +0,0 @@ -# Common `rc` CLI planning - -This document records a proposed direction for a common Runtime Conditions -command-line entry point. It is planning material, not an amendment to -`IMPLEMENTATION.md` and not authorization to change that protected -implementation standard. The proposal must be reconciled with the standard in a -separate, explicit change before implementation work that requires a different -contract begins. - -## Goals - -- Give users one recognizable `rc` command for binding generation and profiling. -- Keep the shared binding resolver, normalizer, and orchestrator in Go. -- Keep source analysis in language-specific profilers that use native parsers - and package metadata APIs. -- Allow every profiler to own its language-specific flags and runtime checks. -- Make language support optional so Go-only users do not need to install Python, - Java, Rust, Node.js, or Ruby runtimes without using those profilers. -- Distribute the CLI and optional profiler add-ons through a small number of - operating-system package-manager channels. -- Keep generated language SDKs in their native package ecosystems. -- Preserve exact tool identity and reproducibility for binding verification and - release workflows. - -## Proposed architecture - -`rc` is a Go executable built with Cobra. It owns the command tree, shared -configuration and diagnostics, binding orchestration, add-on discovery, and -process routing. It does not parse Python, Java, Rust, JavaScript/TypeScript, or -Ruby source itself. Each profiler remains a separately implemented and released -program in the language it analyzes. - -The boundary is a subprocess contract rather than an in-process language plugin -ABI. The core discovers a language profiler executable, passes arguments as an -argument vector without shell evaluation, preserves the working directory and -environment, streams stdout and stderr, propagates cancellation, and returns the -profiler's exit status. Profiles and other machine-readable results can -therefore continue to use stdout without launcher messages corrupting them. - -Each add-on should expose a small machine-readable identity/capabilities command -containing at least: - -- add-on name and version; -- CLI protocol version; -- supported `rc` and contract/schema version ranges; -- language and minimum runtime/tool requirements; -- the executable command used for profiling. - -`rc` can use this metadata for `plugins list`, compatibility checks, and -`doctor` diagnostics. The metadata contract should remain small and should not -attempt to describe every language-specific flag. Language commands own those -flags and their help text. - -For production binding builds, `toolchain.lock.yaml` remains authoritative for -the exact normalizer, orchestrator, emitters, profilers, and native toolchain -versions and artifact digests. A release build must execute the locked artifacts -and record their identities; it must not silently use whichever add-on happens -to appear first on `PATH`. Interactive discovery may use the system-installed -add-ons, subject to compatibility checks. - -## Proposed command tree - -The existing Phase 5 binding command group remains the primary native command -tree: - -```text -rc bindings resolve -rc bindings normalize -rc bindings generate -rc bindings verify -rc bindings package -rc bindings plan-release -rc bindings check -rc bindings update -``` - -The existing `--packages`, `--toolchain-lock`, `--cache`, `--work-dir`, target, -resolution, and output semantics belong to the `bindings` command group and its -relevant child commands. They should not become root flags or profiler flags. - -Profiling is routed by language. The language name selects an installed profiler; -the remaining command and arguments are owned by that profiler. Examples: - -```text -rc profile go generate --dir ./service --out profile.yaml -rc profile python profile generate --project ./service --python ./venv/bin/python -rc profile java generate --project ./service --java-home /opt/jdk-21 --javac /opt/jdk-21/bin/javac -rc profile rust --help -``` - -The exact verb shape should be reconciled across profiler CLIs during protocol -design. The important requirement is that the dispatcher does not normalize -language-specific flags such as `--java-home`, `--javac`, `--python`, -`--cargo-home`, `--node`, or `--ruby`. Each frontend validates and documents its -own environment options. - -Useful core commands include: - -```text -rc --help -rc version -rc doctor -rc plugins list -rc profile --help -``` - -Cobra owns help, command discovery, argument validation for native `rc` -commands, and shell completion for the static tree. A language profiler's own -help is delegated to that profiler. Dynamic completion of add-on-specific flags -can be considered later; it must not be a reason to couple all profiler flags -to the core binary. - -Only flags with genuinely identical meaning across all relevant commands should -be global persistent flags. Candidates include verbosity, color, and a shared -configuration-file location. Binding paths and language runtime paths remain -scoped to their respective command/backend. - -## Cobra implementation shape - -Use a standard Cobra root command and small command constructors, keeping -business logic in the existing orchestrator and plugin-routing packages: - -```text -orchestrator/ - cmd/rc/main.go - internal/cli/ - root.go - bindings.go - profile.go - plugins.go - doctor.go - internal/plugins/ - discover.go - invoke.go -``` - -`main.go` should only create and execute the root command, report errors, and -choose the process exit code. `bindings.go` binds Cobra flags to the Phase 5 -orchestrator options. `profile.go` routes the language selector and forwards -the remaining arguments untouched. `plugins.go` implements add-on listing and -metadata parsing. `doctor.go` performs read-only environment checks. - -For profiler forwarding, the language dispatch command must avoid Cobra -consuming backend flags. Cobra's `DisableFlagParsing` behavior can support this -proxy boundary. The implementation should explicitly define how `--help`, -`--version`, shell completion requests, unknown profiler names, and the `--` -separator are handled so users can predict which process receives each token. -The subprocess invocation must use `exec.CommandContext` or equivalent with an -argument slice, never a shell-assembled command string. - -The current `orchestrator/cli.go` manually routes commands and uses Go's standard -`flag` package. A Cobra migration should preserve its behavior and output -contracts rather than changing binding-generation semantics as a side effect. - -## Add-on distribution - -Publish one system-package channel per supported operating-system family, with -the core and language profilers as packages in that same channel. For example: - -| Package | Contents and dependencies | -| --- | --- | -| `rc` | Go CLI, binding orchestrator, Go emitter/tools that are part of the supported core workflow | -| `rc-profiler-go` | Go profiler executable and its compatibility metadata | -| `rc-profiler-python` | Python profiler and dependencies; declares or documents Python 3.11+ | -| `rc-profiler-java` | Java profiler and dependencies; declares or documents required Java tooling | -| `rc-profiler-rust` | Rust profiler and dependencies, when available | -| `rc-profiler-node` | JavaScript/TypeScript profiler and dependencies, when available | -| `rc-profiler-ruby` | Ruby profiler and dependencies, when available | - -On macOS, a Homebrew tap can hold a core formula and optional profiler formulae. -On Debian/Ubuntu, a signed APT repository can hold corresponding packages. RPM -repositories can use the same package split if added to the support matrix. The -core install should not pull optional language runtimes. Users install only the -backends they need, through the same operating-system package manager they used -for `rc`. Convenience meta-packages can be offered for users who deliberately -want several or all backends. - -Runtime dependencies require a declared support matrix. A system package can -depend on an available runtime version, or the profiler package can provide a -managed runtime if that is an explicit product choice. For example, Python 3.11+ -availability varies across supported Linux distributions; the package policy -must not assume that every system repository provides the required minor -version. Java target JDK selection can remain an explicit profiler option even -when the profiler itself has a separate runtime requirement. - -Generated binding packages are not installed through these system packages. -They remain dependencies of workload projects and use the native ecosystem: -Go modules, Python package indexes, Maven, npm, Cargo, RubyGems, and others as -applicable. The `rc` system-package channel distributes the tooling; it does not -replace project-level package resolution. - -## Compatibility, release, and security requirements - -- Version the CLI-to-add-on protocol independently and reject unsupported - protocol versions with an actionable message. -- Define supported `rc`/profiler compatibility ranges and contract/schema - versions in add-on metadata. -- Keep locked release verification separate from ambient plugin discovery. -- Record exact executable artifact digests and native tool versions in release - provenance as already required by the implementation standard. -- Invoke only trusted, resolved executable paths and never evaluate plugin - metadata as code. -- Treat profiler output as data; preserve stdout exactly and prefix only - human-facing launcher diagnostics on stderr. -- Ensure package-manager dependencies are optional by language, with a clear - install and removal path for each add-on. -- Keep the add-on protocol backward-compatible where practical; make breaking - protocol changes explicit and versioned. - -## Suggested rollout - -1. Review this proposal against the protected implementation standard and - explicitly authorize any required change before altering that standard. -2. Adopt Cobra for the existing Go `rc` entry point while preserving Phase 5 - binding command behavior. -3. Define and document the profiler add-on metadata and subprocess contract. -4. Integrate the existing Go and Python profiler CLIs behind `rc profile` and - verify that their language-specific flags, output, and exit statuses pass - through correctly. -5. Add `plugins list` and `doctor` runtime/compatibility reporting. -6. Package the core and existing profiler add-ons through the selected Homebrew - and Linux repository channels. -7. Add Java, Rust, JS/TS, Ruby, and later profilers as independently released - add-ons without changing the core command contract unless a shared capability - is added. - -## Decisions still needed - -- Whether profiler invocations use one standardized operation vocabulary or - expose each backend's full native subcommand tree after the language selector. -- The exact plugin executable naming and lookup order, including install-relative - paths versus `PATH`. -- Which global `rc` flags, if any, have uniform semantics. -- Whether each OS package manager installs only available runtime dependencies - or can offer managed runtime packages for unsupported system versions. -- Initial OS, architecture, and Linux distribution support. -- Whether dynamic shell completion for profiler-owned flags is a launch - requirement or a later enhancement. diff --git a/tooling/extension-bindings/FUTURE_WORK.md b/tooling/extension-bindings/FUTURE_WORK.md deleted file mode 100644 index 34bad09..0000000 --- a/tooling/extension-bindings/FUTURE_WORK.md +++ /dev/null @@ -1,92 +0,0 @@ -# Future extension-binding work - -This file records follow-up work. It is not an amendment to -`IMPLEMENTATION.md` and does not change the current implementation contract. - -## TODO: Establish a common `rc` CLI entry point - -Design and implement a Go-based `rc` CLI using Cobra as the single user-facing -entry point for Phase 5 binding orchestration and the language-specific -profilers. Preserve each profiler's language-specific flags and runtime -requirements by routing profiler commands to separately released add-ons, with -an explicit versioned invocation and capabilities contract. Define add-on -discovery, compatibility checks, runtime diagnostics, and exact locked-tool -selection for production verification. Distribute the core and optional profiler -packages through a small number of operating-system package-manager channels -(for example, a Homebrew tap and signed Debian/APT repository), keeping language -runtimes optional unless a selected add-on requires them. Generated binding SDKs -remain distributed through their native package ecosystems. See -`CLI-PLANNING.md` for the proposal. Reconcile and explicitly authorize any -required change to the protected `IMPLEMENTATION.md` before implementation -changes that would alter its contract. - -## Distribute and synchronize profiler contract schemas - -`go-rc-profiler` currently keeps checked-in copies of the binding manifest, -binding model, binding release, and extension semantic schemas under -`extensioncheck/schema/`. -`go:embed` puts those local files in the profiler binary; it does not fetch or -synchronize them with `tooling/extension-bindings/model/`. The copies can drift -when a schema changes. - -Define a versioned, checksummed way for each independently released profiler to -consume these contract schemas. Automate copying or generating the profiler's -embedded schema assets from that pinned source, and add a release check that -detects drift and rejects unsupported contract versions. The installed profiler -must remain self-contained and must never require an `extensions` checkout or a -runtime network fetch for schema validation. - -## TODO: Unify profiler package naming - -Define a unified naming convention for all language-specific profiler packages, -including published distribution names, module or import names, and CLI names. -Apply it consistently to package metadata, release workflows, Trusted Publisher -settings, installation instructions, smoke checks, and profiler provenance. -Derive distribution names from package metadata in release checks where possible. - -The Python distribution name `runtimeconditions-profiler` is provisional. Decide -its final name under the shared convention and update the hard-coded references -before enabling PyPI publication. - -## Standardize emitter diagnostic codes - -Define and document a shared diagnostic-code standard before treating the -Python emitter's current `RCP` codes as a stable public interface. The standard -should specify code ownership and ranges across the normalizer, emitters, and -orchestrator; the diagnostic fields and text format; how codes are versioned or -retired; and which negative conformance fixtures assert each diagnostic. Review -the existing Go `RCG` codes when assigning cross-language meanings. Code -numbers that look alike across languages must not silently imply the same error -unless the standard says so. - -The Python emitter currently uses `RCP` for Runtime Conditions Python. The -following meanings describe the implementation as it stands; they are -provisional and require review as part of the standardization work. - -| Code | Current meaning | -| --- | --- | -| `RCP1001` | YAML input cannot be read or exceeds the size limit. | -| `RCP1002` | YAML syntax, profile, structure, or resource-limit failure. | -| `RCP1003` | Binding-model field, value, or structural validation failure. | -| `RCP1004` | Unsupported binding-model `apiVersion`. | -| `RCP1005` | Unsupported binding-model `kind`. | -| `RCP1006` | Invalid Python package-target field or dependency metadata. | -| `RCP1007` | Target source directory does not match its package key. | -| `RCP1008` | Unsupported minimum Python version. | -| `RCP1009` | Target root extension or direct dependency set differs from the model. | -| `RCP1010` | Unknown structural shape kind. | -| `RCP1011` | Inconsistent extension closure or declaration ownership. | -| `RCP1012` | Inconsistent shape details, value domain, or unresolved reference. | -| `RCP2000` | A source name cannot be derived as a valid Python identifier. | -| `RCP2001` | Generated symbol requests or allocated names collide. | -| `RCP3001` | Source output directory is occupied or is a symbolic link. | -| `RCP3002` | Package output directory cannot be inspected or generated package files cannot be written. | -| `RCP4001` | Generated package source tree is unavailable, altered, or contains a symbolic link. | -| `RCP4002` | Pinned Python interpreter, build tools, or source formatter are unavailable, fail, or do not match the lock. | -| `RCP4003` | The pinned native Python package build fails. | -| `RCP4004` | Wheel, source distribution, or generated source file set is missing, undeclared, altered, or malformed. | -| `RCP4005` | Archive output directory is occupied or canonical archives cannot be written. | - -Until the standardization work is done, keep these codes and their current -tests in place. Record any deliberate reassignment or split of a code with the -corresponding diagnostic fixtures and migration note. diff --git a/tooling/extension-bindings/IMPLEMENTATION.md b/tooling/extension-bindings/IMPLEMENTATION.md deleted file mode 100644 index 034c456..0000000 --- a/tooling/extension-bindings/IMPLEMENTATION.md +++ /dev/null @@ -1,1255 +0,0 @@ -# Extension Binding Generation Implementation Standard - -## 1. Purpose and scope - -This document defines the architecture, artifact contracts, verification, and -delivery process for generated Runtime Conditions extension bindings. - -The system converts extension definitions and their complete dependency closure -into deterministic, language-native declaration packages. A shared Go resolver -and normalizer interpret extension semantics. Native Go and Python emitters -produce source and structural binding manifests. A Go orchestrator coordinates -resolution, generation, verification, repository updates, and release planning. - -Automated delivery generates and commits selected Go packages to `main`, then -publishes them as public Go modules through a separate manual workflow. Public -imports use `runtimeconditions.io/x//`. Python emission and -local packaging are supported; automated Python delivery and registry -publication are outside the enabled Go workflows. - -The binding implementation remains in `extensions`. The downstream common `rc` -executable belongs to `rc-cli` and will expose this implementation through a -thin library adapter. Language-specific profilers remain independently -implemented and released; the Go profiler also exposes a library API. - -The following requirements apply throughout the pipeline: - -1. Extension vocabulary and JSON Schema drive behavior. Production code MUST - NOT select an algorithm by a particular extension ID, kind, interface type, - field, value, package key, or repository path. -2. Extension definitions are immutable generation inputs. Generation MUST NOT - rewrite them to accommodate an emitter limitation. -3. Unsupported structure MUST fail with a deterministic diagnostic. It MUST NOT - be omitted, guessed, or widened to an unconstrained native type. -4. Identical semantic inputs, delivery configuration, and tool artifacts MUST - produce identical persisted package bytes. -5. Runtime Conditions models, manifests, locks, plans, and reports use YAML. - Native source, HTML discovery pages, package-manager metadata, and archives - retain their required formats. Canonical JSON is an internal hashing and - comparison representation. -6. Generated types enforce structure. Complete core and extension semantic - validation belongs to profile generation. -7. Local commands and GitHub Actions use the same generation, verification, - packaging, and compatibility implementations. -8. Publication promotes verified artifacts without rebuilding them. -9. Semantic identity and source-resolution evidence remain separate. Transport - details and source-byte digests MUST NOT affect the normalized model digest. - -## 2. Ownership and source layout - -The source layout is: - -```text -extensions/ - catalog/ - bindings/ - / - go/ - python/ - tooling/ - extension-bindings/ - IMPLEMENTATION.md - README.md - packages.yaml - toolchain.lock.yaml - model/ - runtimeconditions.extension-semantic.schema.yaml - runtimeconditions.binding-model.schema.yaml - runtimeconditions.binding-manifest.schema.yaml - runtimeconditions.binding-release.schema.yaml - runtimeconditions.package-catalog.schema.yaml - runtimeconditions.toolchain-lock.schema.yaml - runtimeconditions.file-manifest.schema.yaml - conformance/cases/ - conformance/expected/ - normalizer/ - cmd/rc-binding-model/ - emitters/ - go/ - cmd/rc-go-bindings/ - python/ - src/runtimeconditions_binding_emitter/ - orchestrator/ - cmd/rc/ - ci/ - generate.py - publish.py - test_generate.py - test_publish.py - common/ - go_bindings.py - build_extensions_site.py - serialization.py - .github/ - actions/binding-tools/action.yml - workflows/ - extension-binding-normalizer.yml - binding-generate.yml - binding-promote.yml - check-extensions-site-builds.yml - notify-docs-site.yml -``` - -The normalizer, Go emitter, and orchestrator are separate Go modules. The Python -emitter is a Python package. Shared site and publication coordinate validation -lives in `tooling/common/go_bindings.py`. - -Repository responsibilities are: - -| Repository | Responsibility | -| --- | --- | -| `extensions` | Extension catalog, binding schemas, resolver, normalizer, emitters, orchestrator, shared conformance tests, committed generated packages, and binding delivery workflows. | -| `rc-cli` | Common `rc` executable, Cobra command tree, binding adapter, profiler dispatch, shared diagnostics, and system-package distribution. | -| `go-rc-profiler` | Go source analysis, installed Go binding inspection, semantic profile validation, and profiler releases. | -| `python-rc-profiler` | Python source analysis, installed Python binding inspection, semantic profile validation, and profiler releases. | -| `runtimeconditions.github.io` | Deployment of the documentation site and the static output produced by the extensions site builder. | - -Generated binding packages are workload dependencies installed by the native -language package manager. The common CLI, generators, and profilers are developer -tools with their own release identities. - -## 3. Pipeline and execution boundaries - -The pipeline is: - -```text -extension root + dependency definitions + core schema + package catalog - | - v - shared Go resolver - / \ - v v - dependency lock semantic closure - | - v - shared Go normalizer - | - v - runtimeconditions.binding-model.yaml - | - +-------------+-------------+ - | | - v v - Go emitter Python emitter - | | - +-------------+-------------+ - | - v - assembled package resources - | - v - native installation and package verification - | - v - committed generated source - | - v - package and compatibility verification - | - v - immutable module tags and release assets -``` - -The resolver owns dependency resolution, exact definition identity, semantic -validation, vocabulary ownership, and conflict detection. The normalizer owns -language-neutral schema interpretation and structural projection. - -Each emitter consumes only a validated normalized model and a native package -target configuration. Emitters MUST NOT resolve extension definitions, read the -catalog for semantic rules, or reinterpret JSON Schema independently. - -The orchestrator assembles package resources, verifies their relationships, -invokes native tooling, compares generated and committed trees, and prepares -release artifacts. CI helpers select targets, manage Git operations, check public -discovery, and publish the resulting artifacts. - -## 4. Package catalog and tool identities - -### 4.1 Delivery configuration - -`tooling/extension-bindings/packages.yaml` has the envelope: - -```yaml -apiVersion: runtimeconditions.io/package-catalog/v1alpha1 -kind: RuntimeConditionsPackageCatalog -repositoryUrl: https://github.com/runtimeconditions/extensions -packages: - common-integrations: - rootExtension: https://runtimeconditions.io/extensions/rc/common-integrations/v1alpha1/runtimeconditions.extension.yaml - coreProfileSchemaVersion: 0.2.0 - languages: - go: - coordinate: runtimeconditions.io/x/rc/common - name: common - version: 0.1.0 - sourceDirectory: bindings/common-integrations/go - languageVersion: 1.25.0 - publicationMode: github-tag -``` - -A package set declares one extension root and one core schema version. Each -language target declares its native coordinate, import/package name, independent -package version, generated source directory, exact compiler or interpreter -version, and publication mode. A `registry` target also declares `registryId`. - -The target key is `:`. Package keys match -`^[a-z0-9]+(?:-[a-z0-9]+)*$`; language keys match `^[a-z][a-z0-9-]*$`. -The generated source directory is `bindings//`. - -The catalog contains delivery data. Kinds, fields, value domains, schemas, -dependencies, and requiredness come from the extension definitions. - -### 4.2 Workspace and released tools - -The pipeline supports workspace tooling and a released toolchain lock. -Automated Go generation and publication build the orchestrator, normalizer, and -Go emitter from the checked-out workspace. Publication does not require a -separate tooling release before a generated package can be published. - -Generated artifacts record actual tool identities: - -- The model records the normalizer name, version, and artifact SHA-256. -- The structural manifest records emitter identity as - `@sha256:` and an emitter version. -- The release manifest records orchestrator and profiler identities. -- Python emitter identity uses its installed artifact or the actual workspace - source snapshot, as appropriate to the selected execution mode. - -A lock with `status: released` requires the configured installed tools and -checks their versions and digests. Workspace mode builds or locates development -tools and records what actually ran. Neither mode may substitute an invented -release identity. - -The language target controls the exact compiler or interpreter used for package -verification. The Go delivery catalog uses Go `1.25.0`; its Python targets -specify Python `3.12.10`. Helper scripts have a separate Python runtime and do -not enable Python binding delivery by themselves. - -### 4.3 Shared Actions prerequisites - -`.github/actions/binding-tools/action.yml` is shared by Go generation and -publication. It: - -1. Validates the requested Go targets and selects their exact Go compiler. -2. Installs Python `3.12.10` and PyYAML `6.0.3` for CI helpers. -3. Installs the selected Go compiler with automatic toolchain switching disabled. -4. Downloads and verifies the pinned Go profiler archive and core schema. -5. Builds workspace `rc` from `orchestrator/cmd/rc`. -6. Exposes the selected targets, source commit, compiler version, generator path, - and core-schema path to the calling workflow. - -The action owns the prerequisite URLs and source checksums. Its core schema -snapshot supplies the catalog's `0.2.0` input. All downloads are verified before -use. Temporary tools, bytecode, and build intermediates remain outside the -checkout. - -## 5. Extension identity and resolution - -### 5.1 Definition identity - -An extension definition uses `metadata.id` as its exact, absolute URI identity. -`metadata.version` is an optional annotation. Dependency lists contain exact -extension ID strings. A version annotation is not appended to an ID to form a -new resolver key. - -For example: - -```yaml -apiVersion: runtimeconditions.io/v1alpha1 -kind: RuntimeConditionsExtensionDefinition -metadata: - id: https://runtimeconditions.io/extensions/rc/env-configuration/v1alpha1/runtimeconditions.extension.yaml - version: v1alpha1 -spec: - dependencies: - - https://runtimeconditions.io/extensions/rc/common-integrations/v1alpha1/runtimeconditions.extension.yaml -``` - -The extension ID and public Go module coordinate serve different purposes. The -extension ID identifies semantic input; `runtimeconditions.io/x/rc/env` -identifies its Go package. - -The resolver preserves the exact ID spelling. It MUST NOT infer identity from a -repository path, split an ID into provider/service/version components, or impose -a particular URI path layout. For HTTPS retrieval, the ID is the retrieval URL. -The returned document's `metadata.id` MUST equal the requested ID. - -### 5.2 Resolution sources - -Resolution supports explicitly supplied file overrides, configured catalog -roots, package-local extension resources, a verified content-addressed cache, -and HTTPS retrieval. Local candidates are indexed by parsed `metadata.id`. - -An absolute URI may be supplied through an explicit local source without an -automatic transport for its scheme. Automatic network retrieval is provided for -HTTPS. An unsupported automatic transport fails with a diagnostic requiring an -explicit source. Plain HTTP is not an automatic retrieval backend. - -Resolution MUST reject: - -- An invalid or empty absolute URI, whitespace, or control characters in an ID. -- Different source bytes registered for the same ID. -- A requested ID that differs from the resolved definition's ID. -- Missing dependencies and dependency cycles. -- Duplicate or conflicting vocabulary ownership in the same semantic scope. -- A cache entry whose bytes differ from its content-addressed filename. - -Local overrides are explicit development inputs and are forbidden with a -released toolchain lock. A package cache accelerates retrieval; it does not -establish identity. - -### 5.3 HTTPS and lock behavior - -HTTPS resolution validates certificates, rejects redirects, and requires a host -without embedded credentials. Downloads have bounded size and timeouts. - -Development resolution may fetch an unlocked definition and record the exact -result. Released resolution requires a source digest and locator lock before -fetching. A locked locator MUST equal the requested HTTPS ID, and fetched bytes -MUST match the locked source digest. A supplied semantic digest is also checked. -Network-disabled resolution MUST perform no outbound request. - -The extension cache stores files named ``, `.yaml`, or -`.yml`. Each entry is hashed before it can participate in resolution. - -### 5.4 Closure and dependency lock - -Resolve the root and every transitive dependency, detect cycles through the -active traversal stack, then produce a stable topological order with providers -before dependents. Independent ties are ordered by exact ID. - -Each dependency-lock entry contains: - -- Extension ID and any declared version annotation. -- Exact source-byte SHA-256 and semantic SHA-256. -- Exact direct dependency ID strings. -- Source backend and locator. - -The semantic closure contains the ID, optional version, semantic digest, and -direct dependency IDs. It excludes source-byte digests and transport evidence. - -The lock MUST cover the closure exactly once per ID. Missing, extra, duplicate, -or mismatched entries stop generation. Source records are checked against the -resolved bytes; semantic records are checked against the normalized inputs. -The lock is embedded in `runtimeconditions.binding-release.yaml`. - -## 6. Canonical data and normalized model - -### 6.1 Canonicalization - -Validate definitions against -`model/runtimeconditions.extension-semantic.schema.yaml` before interpreting -or hashing their semantics. Parsing is data-only and rejects duplicate mapping -keys and unsupported YAML constructs. - -Source-byte SHA-256 hashes the exact input bytes. Semantic SHA-256 hashes the -canonical JSON representation of validated data after schema-defined sequence -normalization. Mapping keys use canonical ordering. Set-valued sequences are -sorted; source-ordered sequences retain their order. - -Dependency and vocabulary lists are sets. JSON Schema `enum`, `required`, -`allOf`, `anyOf`, and `oneOf` lists are normalized as sets. Arrays used as data, -`prefixItems`, and `examples` preserve source order. Schema annotations identify -the applicable ordering rule. - -Generated YAML uses UTF-8, LF line endings, one trailing newline, string mapping -keys, deterministic field order, quoted ambiguous strings, and omitted unused -optional fields. Persisted model YAML contains no comments, anchors, aliases, -merge keys, or custom tags. - -### 6.2 Model envelope and contents - -The checkpoint is `runtimeconditions.binding-model.yaml`: - -```yaml -apiVersion: runtimeconditions.io/binding-model/v1alpha1 -kind: RuntimeConditionsBindingModel -``` - -Its schema is `model/runtimeconditions.binding-model.schema.yaml`. The model -contains: - -- Model API version and normalizer identity. -- Core schema ID, version, and semantic digest. -- Root extension ID, optional version annotation, and semantic digest. -- Complete extension closure and direct dependency edges, using exact ID - strings for references. -- Vocabulary ownership, owned declarations, and imported declaration contracts. -- Kind and interface scopes, condition fields, and interface fields. -- Explicit field-path segments, including array traversal. -- Scoped value domains with exact serialized values. -- Complete applicable JSON Schemas and structural projections. -- Validation constraints and semantic provenance. -- A semantic SHA-256 for the model with its own digest field excluded. - -Owned and imported declarations form a complete, non-overlapping partition of -kind declarations in the closure. Imported declarations remain owned by their -provider package. - -The model MUST NOT contain source-byte hashes, source backends, source locators, -dependency-lock digests, native symbol names, package coordinates, or -language-specific types. Presentation-only definition changes and changes to -resolution transport MUST leave model bytes and the model digest unchanged. - -Provenance identifies an owning extension and semantic digest, a vocabulary or -schema coordinate, and a JSON Pointer where a node comes from JSON Schema. -Set reordering MUST NOT change semantic coordinates. - -## 7. Structural normalization - -Schemas use JSON Schema Draft 2020-12. An omitted dialect selects Draft 2020-12; -a different explicit dialect fails. Exact schemas are retained for semantic -validation even when native type systems cannot express every constraint. - -All extensions use these normalization rules: - -1. An owned kind becomes a declaration. Dependency-owned kinds become imported - declaration contracts. -2. An interface type becomes an object shape in its exact kind/interface scope. - Fixed `kind` and `interface.type` values are generated metadata. -3. Condition and interface fields retain their exact serialized property names - and placement. Scope expansion uses the complete resolved vocabulary. -4. Objects become object shapes; scalars retain their structural scalar type. -5. Arrays become collection shapes, with explicit array traversal in paths. - Object-valued items receive shapes derived from their full property paths. -6. Schema-valued `additionalProperties` becomes a map-value shape. -7. String enums, string constants, and scoped string `fieldValues` become named - value domains. Non-string values remain validation constraints. -8. Object-only `oneOf` and `anyOf` branches project to a merged property set. - A property is structurally required only when every alternative requires it. - Branch-specific requirements remain semantic constraints. -9. Heterogeneous alternatives remain explicit union shapes. -10. `allOf` combines constraints and object requirements conjunctively. - Incompatible structural types fail normalization. -11. Local JSON Pointer `$ref` values resolve within the containing schema. - Referenced definitions become named shapes; recursive references remain - references instead of being expanded indefinitely. -12. External references, anchor references, and unsupported structure-changing - keywords fail with the extension ID, schema coordinate, JSON Pointer, and - relevant keyword. -13. Cardinality, uniqueness, ranges, lengths, patterns, formats, conditionals, - and relationships between branches remain exact validation constraints. -14. Applicable schemas combine additively. Structural conflicts and empty value - intersections fail normalization. -15. Each scoped value domain must name an existing field path, and every member - must be accepted by all applicable schemas. - -Descriptions, examples, repository paths, and operation-specific conventions -MUST NOT determine the generated API. - -## 8. Native package dependencies - -The extension dependency graph is projected onto each requested language. -Every direct extension dependency requires a corresponding native package -provider in that language. A missing provider fails before source emission. - -Dependent packages import provider contracts. They MUST NOT copy provider-owned -declarations into their own package or claim ownership of imported vocabulary. -Marker interfaces and protocols support additive fields across packages. - -Candidate builds use exact tested provider versions. Package release metadata -also records the compatible interval and exact provider archive SHA-256. - -- Go `go.mod` declares the tested version as its minimum requirement. -- Python metadata declares `>=,`. -- For a `0.y.z` dependency, the next breaking boundary is `0.(y+1).0`. -- For a dependency at or above `1.0.0`, it is `(major+1).0.0`. - -Native package resolution determines the actual installed packages. Go uses -module download, verification, and listing commands. Isolated candidate -verification uses a local module proxy and module cache. Python uses isolated -virtual environments, wheel installation, and installed distribution metadata. - -Workspace wiring and temporary native consumers are build inputs. Published Go -packages and end-user installation MUST NOT depend on local `replace` -directives, sibling source checkouts, or recursively scanning package caches. - -## 9. Emitter and package contracts - -### 9.1 Emitter interface - -Each emitter accepts: - -```text - --model runtimeconditions.binding-model.yaml \ - --package-config --output -``` - -The Go executable is `rc-go-bindings`. The Python emitter exposes its native -package command and an `emit` operation. The orchestrator supplies its assembly -mode when preparing deliverable Python source. - -An emitter rejects an unsupported model API, invalid target, unsupported shape, -or non-empty output directory. It writes formatted production source, native -package metadata, and `runtimeconditions.bindings.yaml`. - -Native names derive from exact source names and the target language's naming -rules. The model remains free of native naming decisions. The manifest retains -exact serialized names and model coordinates. - -Shared API rules are: - -- Declaration functions are inert source anchors returning `Declaration`. -- Object, collection, and map shapes use native construction syntax. -- Root fields remain declaration arguments or root properties. -- Array-item names use the property path and `Item`, without singularization. -- Names are allocated for the complete package before source is written. -- Eligible collisions use parent path and scope components deterministically. - Unresolvable collisions fail instead of gaining arbitrary suffixes. -- Alternative branches do not create operation-specific constructors. -- Cross-field semantic constraints are enforced by profile validation. - -### 9.2 Go API - -An owned kind becomes a declaration function accepting its generated -`Field` marker interface. Applicable interface objects and additive fields -implement that interface. Cross-package marker methods are exported and derive -from the owning declaration coordinate. - -Objects become structs, collections become slices, and maps use native map -types. Required scalar and enum fields use values; optional scalar and enum -fields use pointers. Optional structured values preserve omission according to -the generated reference shape. String domains become named scalar types with -typed constants qualified by their domain type. - -Go names preserve Unicode letters and use language-specific token boundaries -and Pascal case for exported names. Invalid leading-digit identifiers and -collisions with fixed declaration symbols fail with semantic coordinates and -the conflicting native symbol. Declaration symbols are not renamed to conceal -a collision. - -Packages contain `bindings.go` and `go.mod`. Source is `gofmt` formatted and -passes compilation and `go vet` with the configured compiler. Package-scope -usage may use `var _ = package.Declaration(...)`; declarations may also appear -inside functions when the profiler can statically determine their arguments. - -Public Go package names match the final component of the base public import -path, so callers do not need explicit aliases. - -### 9.3 Python API - -Owned kinds become functions returning inert declarations. Kind field -contracts use structural protocols. Objects become frozen, keyword-only -dataclasses; optional fields accept `None`; collections and maps use native -sequence and mapping forms. String value domains use scoped `StrEnum` members. - -Classes and aliases use Pascal case; functions and fields use snake case; -constant members use upper snake case. Reserved words, leading digits, and -special-method spellings follow explicit Python escaping rules. - -Python source lives under `src//`, includes typing metadata, -and is packaged through `pyproject.toml`. Verification uses the configured -interpreter, Ruff formatting, byte compilation, and strict mypy checking. - -### 9.4 Package assembly - -The orchestrator adds these fixed resources without rewriting emitter output: - -| Resource | Purpose | -| --- | --- | -| `runtimeconditions.bindings.yaml` | Structural relationships between native symbols and model coordinates; emitted with the source. | -| `runtimeconditions.binding-model.yaml` | Exact normalized model consumed by the emitter. | -| `runtimeconditions.extension.yaml` | Exact validated root definition bytes. | -| `runtimeconditions.binding-release.yaml` | Native package identity, model identity, dependency lock, tested native dependencies, and tool provenance. | - -Go places all four beside `bindings.go` in the package directory returned by -`go list`. Python includes them as package data under `src//`. -Dependency definitions are supplied through their own installed packages. - -The package-tree root also contains `runtimeconditions.file-manifest.yaml`, -which hashes every declared package file except itself. Delivered source trees -contain production source, native metadata, the four resources, and this file -manifest. Conformance source and expected profiles belong to shared tooling -fixtures and temporary consumers. - -Generated headers identify non-editable output, model digest, and emitter -version. They contain no timestamp or host path. Source-byte digests and -resolution locators remain release provenance. - -## 10. Structural manifest and profiler integration - -The structural manifest envelope is: - -```yaml -apiVersion: runtimeconditions.io/bindings/v1alpha2 -kind: RuntimeConditionsBindingManifest -``` - -`model/runtimeconditions.binding-manifest.schema.yaml` defines its declarations, -imported marker contracts, root bindings, and named types. References identify -both native structure and exact model coordinates or JSON Pointers. - -The manifest records native package identity, model API and digest, root -extension ID and semantic digest, and emitter identity. Its extension identity -is independent of the optional definition version annotation. - -The independently installed profiler begins from imported symbols, asks the -native package manager for their resolved locations, and reads the fixed -package resources there. An application author needs installed binding modules -and the profiler, without an extensions or generator source checkout. - -Profilers MUST: - -1. Type-check or parse source with the language's native analysis tools without - executing the application or declaration functions. -2. Verify native package identity against installed package metadata. -3. Validate all packaged resource schemas and recompute model and root - definition digests. -4. Verify dependency-lock coverage, provider identities, package versions, - compatible intervals, and dependency archive content. -5. Check manifest-to-model references and vocabulary ownership. -6. Reconstruct Conditions only from supported static expressions. -7. Identify extensions that directly contribute vocabulary and traverse their - complete installed dependency closure. -8. Validate core profile structure and every applicable extension schema. -9. Write a profile only after all checks succeed. - -Current binding profiles list complete extension ID URIs directly. URI -references in dependency locks and package-dependency records are resolved -against the verified model closure; optional annotations are not inferred by -parsing URI segments. - -The Go profiler supports the exact approved core `0.2.0` input identity used by -these bindings while validating generated output with core `0.4.0`. This -compatibility requires the approved IDs, versions, and semantic digests. -Other core identities must satisfy the profiler's installed-schema checks. - -Go module ZIP verification accepts the recorded publisher archive bytes or -reconstructs the publisher's deterministic ZIP from the downloaded module -files. The reconstructed SHA-256 must match the recorded value exactly. Proxy -ZIP encoding differences therefore do not remove content verification. - -Static pointer literals can express optional scalar values, for example: - -```go -common.KeyValue{ - Engine: &[]common.KeyValueEngine{common.KeyValueEngineRedis}[0], -} -``` - -A variable, function call, or other expression outside the profiler's supported -static subset fails with a diagnostic rather than producing a partial profile. - -## 11. Verification and shared conformance - -### 11.1 Shared tooling coverage - -The shared suites exercise the generation mechanism using language-neutral -fixtures and temporary native consumers. The fixture set covers: - -1. Owned kind and interface. -2. Additive fields targeting provider-owned vocabulary. -3. Transitive dependency closure. -4. Dependency cycles. -5. Vocabulary ownership conflicts. -6. Recursive local references. -7. Object alternatives with branch-dependent required fields. -8. Heterogeneous unions. -9. Collections and maps. -10. Scoped domains and native naming collisions. -11. Source-name preservation. -12. Unsupported structural keywords. -13. Dependencies that contribute validation schemas without direct declarations. - -Positive fixtures retain expected normalized YAML; negative fixtures retain -deterministic diagnostics. Native API exercises are generated or materialized -in temporary consumers, without adding test trees to delivered packages. - -Tests cover repeated normalization and emission, set-order permutations, -source-order preservation, archive inventories, native API extraction, package -composition, resolver backends, release classification, workflow helpers, and -repository synchronization. Production algorithms remain independent of -fixture identifiers. - -Shared tooling tests require no profiler checkout, binary, or wheel. -Profiler-dependent integration and cross-repository compatibility suites belong -in a separate integration repository. The presence of profiler identity in -package provenance is distinct from running a profiler integration suite. - -### 11.2 Per-package verification - -`verify`, `check`, `package`, and `update` enforce package structure through: - -- Model and resource-schema validation, including recomputed semantic digests. -- Catalog, native metadata, root definition, manifest, and release identity - consistency. -- Dependency installation and exact provider relationships. -- Actual tool and profiler artifact identities recorded in provenance. -- Native formatting, compilation, and static analysis. -- AST-derived native API equality with the normalized model projection. -- Re-emission and assembly equality with the candidate package tree. -- Complete archive inventory and file-byte equality. -- Complete file-manifest coverage and digests. - -Reports identify `scope: package-structure`. Gate entries 7 through 11 are -`not-applicable` for individual delivered packages. Generated API unit exercises, -conformance profile comparisons, and negative semantic declarations are not -represented as per-package checks that ran. - -A failed applicable check stops update, packaging, or publication. All selected -candidates are verified before `update` synchronizes repository source. - -## 12. Local orchestration - -### 12.1 Commands - -The local entry point is: - -```text -rc bindings resolve -rc bindings normalize -rc bindings generate -rc bindings verify -rc bindings package -rc bindings plan-release -rc bindings check -rc bindings update -``` - -The standalone executable is built from `orchestrator/cmd/rc` and remains -supported independently of the common CLI. Its argument parser is -`orchestrator.Run(context.Context, []string, io.Writer, io.Writer)`. -It accepts the `bindings` command group and delegates to the library boundary: - -```go -orchestrator.Execute(ctx, cwd, operation, options, stdout, stderr) -``` - -`Execute` accepts a context, an absolute working directory, an operation name, -typed `Options`, and non-nil output writers. It parses no command arguments and -does not change the process working directory. Initialize options using -`orchestrator.DefaultOptions()` to obtain the standalone native-tool defaults -from the current environment, then apply explicit overrides. Explicit empty -values are preserved. Relative input, output, override, and executable paths -resolve against the supplied directory; bare tool names retain PATH lookup. -The executable supplies process arguments and streams and chooses the exit code. - -| Command | Behavior and output | -| --- | --- | -| `resolve` | Prints semantic closure and dependency lock as YAML; writes only explicitly requested closure/lock files. | -| `normalize` | Resolves and validates inputs, then prints the normalized model; optional model and lock output files. | -| `generate` | Writes selected generated package trees beneath a required new or empty output directory. | -| `verify` | Verifies supplied package trees or selected committed trees; prints YAML and optionally writes a report. | -| `package` | Regenerates for comparison, requires equality with committed source, verifies it, and archives the committed trees. | -| `plan-release` | Compares committed targets with published target artifacts and reports compatibility and version requirements. | -| `check` | Regenerates and verifies, then compares selected committed trees without modifying them. | -| `update` | Generates and verifies all candidates, then synchronizes selected committed trees and removes stale generated files. | - -All commands share target selection, configuration discovery, resolution, -normalization, and native tooling behavior. `update` is the sole binding command -that synchronizes committed generated source. - -### 12.2 Inputs and filesystem behavior - -Common configuration flags include `--packages`, `--toolchain-lock`, -`--tooling-dir`, `--cache`, and `--work-dir`. Target selection uses repeatable -`--target :` flags; omission selects all configured targets. - -Configuration discovery walks ancestors for the nearest directory containing -both catalog and toolchain configuration. An explicit configuration path sets -the sibling default for the other configuration file. Supplied relative paths -resolve against the caller's working directory. - -Resolution commands accept explicit extension roots, local overrides, catalog -roots, a dependency lock, and a core-schema file where applicable. Output, -input, and report flags belong to the commands that consume them. - -Default invocations create no persistent cache or fixed work tree. Required -subprocess files use an invocation-specific temporary workspace removed on -return. Explicit `--work-dir` retains required intermediates; explicit `--cache` -enables verified content-addressed reuse. - -Explicit file outputs must be new files, and directory outputs must be new or -empty directories. Explicit outputs cannot be placed inside committed -`bindings/`; callers use `update` for that operation. Symlink and path-escape -checks protect source and output boundaries. - -Stdout remains machine-readable where the command promises YAML. Human progress -and error diagnostics use stderr. Errors produce a nonzero process result. - -## 13. Integration with the common `rc` CLI - -### 13.1 Command ownership - -`rc-cli` will supply the user-facing Go executable and Cobra command tree. It -will expose the eight `rc bindings` operations through a thin adapter to the -binding tooling maintained in this repository. - -The adapter MUST preserve target and configuration defaults, argument meaning, -working-directory behavior, output formats, filesystem effects, cancellation, -and nonzero failure behavior. Binding flags stay scoped to `rc bindings` and -its subcommands. Cobra commands delegate semantic interpretation and generation -to the tooling in `extensions`. - -The binding tooling owns: - -- Definition resolution and dependency locks. -- Semantic normalization and model schemas. -- Native emission and package resource assembly. -- Verification, deterministic regeneration, and repository synchronization. -- Compatibility classification and release planning. - -The common CLI owns command discovery, help, shared configuration and -diagnostics, version reporting, tool discovery, and process dispatch. It MUST -NOT maintain a second binding generator or duplicate compatibility rules. - -### 13.2 Binding adapter and distribution - -The common CLI MUST import the Go orchestrator and call `Execute` with typed -options from native Cobra commands. It MUST NOT rebuild an argument vector for -`Run` or dispatch to a separate `rc-bindings` executable. Generated SDKs under -`bindings/` are workload dependencies; the generator library lives under -`tooling/extension-bindings/orchestrator`. - -The orchestrator, normalizer, and Go emitter modules must be available as a -resolvable, versioned dependency set. Relative `replace` directives used for -development inside `extensions` do not supply dependencies to a downstream -module. Installed schema and emitter resources must work outside a source -checkout. The common CLI integration will call exported Go normalization and -emission functions directly; Python tooling remains optional for Python targets. - -Standalone generation in `extensions` MUST remain functional. Its entry point, -native-tool options, and ability to select an independently installed Go -profiler executable MUST remain supported. `Execute` preserves the existing -executable-based tooling and artifact identities as the default mode. - -Library callers may set `Options.UseGoLibraries` to call `normalizer.Normalize` -and `goemitter.Emit` directly. `Normalizer` and `GoEmitter` must then be empty; -conflicting executable selections fail instead of being ignored. This option -does not change profiler selection: callers may use `LinkedGoProfiler` or retain -a standalone `GoProfiler` executable. Python emission remains external. - -In library mode, normalizer and Go emitter identities retain their component -names and versions, with the SHA-256 of the actual host executable (`rc` when -integrated). No module checksum is substituted for an executable digest. -Rebuilding the host changes those identities and the normalized model digest. -Artifact locks must pin that host digest with the applicable component name and -version; a lock for a separately built normalizer or emitter fails. These checks -run before generation creates work files. Verification and regeneration use -the selected execution mode and retain the existing schema and identity checks. -Cancellation is checked around direct calls; the component APIs cannot interrupt -an active normalization or emission call. Schema resources are still required -through tooling discovery; packaging them for the common CLI is separate work. - -Linked profiler support MUST be explicit and optional. Its identity must record -the actual linked module version and dependency checksum. Metadata schemas, -lock validation, and profiler schema consumers must support that identity before -new metadata is emitted. An executable SHA-256 and a module checksum identify -different artifacts; a linked identity MUST NOT satisfy an executable lock. -Explicit standalone profiler selection MUST retain executable identity checks. - -The CLI integration must retain actual executing-tool provenance and all lock -checks. A separately installed CLI version is not a substitute for an emitter, -normalizer, orchestrator, or profiler artifact identity. Workspace operation -remains explicit; released operation verifies selected artifacts and digests. - -The common CLI and binding tooling are independently versioned. Their supported -interface and artifact selection must be declared as part of CLI packaging. -System packages distribute the CLI and developer tools; applications continue -to install generated bindings through Go modules or their language equivalent. - -### 13.3 Profiler routing - -Profiling is a separate command family: - -```text -rc profile generate -rc profile go generate -rc profile python -``` - -The common CLI links the independently versioned Go profiler as a Go module. -Native Cobra commands bind typed options and invoke its exported functions; -default and explicit Go routes share the same command constructors. Go help and -flags use Cobra, including `--dir` and `--out`. Other languages are optional -profiler add-ons with their own source parsers and runtime requirements. - -Optional profiler commands forward their argument vectors without translating -language-specific options. Their backend help and output remain owned by the -profiler. Launcher diagnostics must not contaminate profile data on stdout. - -Interactive discovery may use managed installations, explicit configuration, -and `PATH`, subject to protocol compatibility checks. Binding verification and -release operations must continue to honor explicitly selected or locked tools; -interactive discovery must not replace them silently. - -### 13.4 CI integration - -The GitHub workflows call the same binding interface used locally. Adoption of -the common CLI must retain the shared prerequisite setup, exact native compiler, -resource discovery, package verification, source equality checks, and actual -tool identities. - -The common CLI does not replace `generate.py`'s controlled bot commit behavior -or `publish.py`'s GitHub and discovery preflight. It supplies the binding command -backend used by those helpers. Generation and publication remain separate -operations with the permissions and artifact boundaries specified below. - -## 14. Package versions and compatibility - -Each language package has an independent SemVer version declared in the catalog. -Extension annotations and native package versions do not have to match. - -Release planning automatically locates the previous published target artifacts. -It compares: - -1. Normalized extension closures and applicable schemas. -2. Native AST-derived exported APIs. -3. Structural binding manifests and declaration behavior. -4. Direct native package dependencies. -5. Minimum language versions and package coordinates. - -Removal, rename, incompatible type change, optional-to-required change, value -removal, validation tightening, or an unprovable schema-compatibility change is -breaking. Compatible public additions and validation relaxations are additions. -Compatible implementation, packaging, or metadata corrections require an -appropriate correction release. - -For packages at or above `1.0.0`, breaking changes require a major bump, -compatible additions a minor bump, and compatible corrections a patch bump. -For `0.y.z` packages, breaking changes require a minor bump and compatible -additions or corrections require a patch bump. The declared version must meet -or exceed the mechanically required bump. Unchanged package content does not -require a new release. - -A package version names immutable content. Different generated or packaged -bytes cannot reuse a published version. A package-major change must update the -native coordinate when required by the package manager and regenerate affected -dependents. - -## 15. Committed source and retained artifacts - -The repository commits tooling, schemas, package configuration, conformance -fixtures, expected normalized models and diagnostics, and generated source for -enabled targets under `bindings//`. - -Each generated package tree includes its readable source, native package -metadata, four package resources, and file manifest. Tool identities, -dependency locks, native dependency artifact digests, and package versions are -retained in the applicable generated metadata. Regeneration is the mechanism -for updating these files. - -Compiled binaries, bytecode, wheels, source distributions, ZIP archives, native -consumer caches, temporary environments, workflow logs, release plans, and -publication receipts remain outside committed generated source. Workflow -artifacts carry verified release outputs between jobs. - -Generation may commit updated package source to `main` after all selected -candidates pass verification. Publication independently requires a clean -checkout and byte equality between fresh generation and the selected committed -trees. Packaging archives the committed trees. - -## 16. Automatic Go generation - -`.github/workflows/binding-generate.yml`, named **Generate and commit Go -bindings**, runs on relevant changes to `main` and supports manual dispatch on -`main`. - -Selection precedence is: - -1. A non-empty manual `targets` input. -2. The repository variable `BINDING_GENERATION_TARGETS`. -3. `common-integrations:go,env-configuration:go`. - -The input is a comma-separated list of `package-key:go` targets. `all` selects -every configured Go target; it does not skip a target lacking valid inputs. -One run requires one exact Go compiler. Python targets are not accepted by -these workflows. - -The generation job: - -1. Checks out current `main` and records its exact source commit. -2. Runs the shared `binding-tools` action. -3. Runs CI-helper and shared Go tooling suites. -4. Invokes `generate.py update`, which runs `rc bindings update` for the - selected targets with the verified core schema and profiler artifact. -5. Invokes `generate.py commit` to stage only selected generated directories. -6. Creates a `github-actions[bot]` commit when package files changed. -7. Pushes through an ordinary fast-forward update to `main`. -8. Dispatches the existing documentation deployment through - `DOCS_REPO_DISPATCH_TOKEN`, including when generation required no new commit. - -The commit helper rejects unexpected modifications outside selected directories, -a non-empty preexisting index, movement of the checked-out input commit, or a -remote `main` that advanced during generation. It never rebases or force-pushes -candidates over newer inputs. Unchanged output creates no commit. - -Generation and publication share concurrency group `binding-generation-main` -with cancellation disabled. The generation job has `contents: write`; branch -rules must permit its bot commit. Bot pushes made with `GITHUB_TOKEN` do not -supply a recursive generation mechanism, so documentation dispatch is explicit. -Generation does not create module tags or releases. - -## 17. Public Go module discovery - -### 17.1 Import coordinates - -Go bindings are public modules under: - -```text -runtimeconditions.io/x// -``` - -Their source remains in this repository. The package catalog keeps public -coordinates separate from source directories: - -| Target | Public module | Package | Source directory | -| --- | --- | --- | --- | -| `common-integrations:go` | `runtimeconditions.io/x/rc/common` | `common` | `bindings/common-integrations/go` | -| `env-configuration:go` | `runtimeconditions.io/x/rc/env` | `env` | `bindings/env-configuration/go` | -| `aws-s3:go` | `runtimeconditions.io/x/aws/s3` | `s3` | `bindings/aws-s3/go` | - -Configured coordinates do not imply that a target has generated source or a -published version. Additional targets become discoverable when their valid -source trees exist. - -Module names, package names, versions, source directories, repository URL, and -major-version suffixes are validated centrally by `go_bindings.py`. Duplicate -public prefixes, stale module declarations, and mismatched package clauses fail. - -The package name equals the public path's final base component. An alias is -optional: - -```go -import "runtimeconditions.io/x/aws/s3" -``` - -### 17.2 Static discovery pages - -`tooling/common/build_extensions_site.py` builds extension definition artifacts -and Go discovery pages into the same static site output. Extension YAML is -published at the path of each definition's `metadata.id`. - -For each generated Go module, the builder writes -`/x///index.html` with an early metadata tag such as: - -```html - -``` - -The four fields identify the public import prefix, Git transport, repository, -and module subdirectory. This subdirectory discovery form requires Go 1.25 or -later. For major versions `v2` and above, the module coordinate has its required -`/vN` suffix, and the builder publishes both the base discovery page and the -versioned page. - -A `/x/` index links generated modules. Pages include installation commands, -unaliased imports, source links, and Go documentation links. The builder emits -no page for a target without generated Go source. - -The domain `runtimeconditions.io` is served through the existing -`runtimeconditions.github.io` deployment. That deployment already invokes the -extensions site builder. Discovery changes are implemented in the extensions -repository and delivered through that build. - -`.github/workflows/notify-docs-site.yml` dispatches `extensions-updated` for -relevant catalog, site-builder, configuration, and binding changes. The -generation workflow also dispatches after its bot commit. Publication requires -the live discovery pages to be deployed before module tags are created. - -## 18. Manual Go publication - -### 18.1 Workflow inputs and jobs - -`.github/workflows/binding-promote.yml`, named **Publish Go bindings**, uses -manual dispatch on `main` with: - -- `targets`: comma-separated `package-key:go` targets or `all`; empty uses - `BINDING_GENERATION_TARGETS` and then the common/env default. -- `dry_run`: boolean, default `true`. - -Publication expands the requested set to include native package providers and -orders them before dependents. Every selected provider must have valid committed -source and a catalog version consistent with dependency metadata. - -A read-only build job uses the shared prerequisites, runs helper tests, and -invokes `publish.py build`. That helper calls `rc bindings package` and -`rc bindings plan-release`, writes checksums and publication metadata, and -uploads `go-binding-assets` with seven-day workflow retention. - -A separate job with `contents: write` checks out that exact source commit and -downloads those exact artifacts. It performs promotion without invoking an -emitter or rebuilding archives. - -### 18.2 Complete preflight - -Before creating any remote tag or release, `publish.py promote` checks: - -1. The checkout is clean and matches the packaged source commit and target set. -2. Current remote `main` still equals that source commit. -3. Release-plan target identities and versions match the catalog. -4. Every packaged artifact matches the output file manifest and `SHA256SUMS`. -5. Source and module archives contain exactly the committed file inventory and - file bytes at their expected prefixes. -6. Live `?go-get=1` metadata matches the expected public prefix, repository, - and source subdirectory, including base-prefix checks for major versions. -7. Existing module tags identify the same complete module tree. -8. Existing releases have the expected tag and asset names, and every existing - asset has exactly the verified bytes. - -An existing tag may point to an earlier repository commit when its module tree -is identical. An unrelated change elsewhere in the repository does not require -moving that tag. A different module tree or asset under the same version stops -publication and requires a new package version. - -A dry run performs this preflight, including live discovery and collision -checks, then stops without publishing. A missing discovery page is an error even -in a dry run. - -### 18.3 Tags, releases, and assets - -The immutable module tag is: - -```text -bindings//go/v -``` - -For example: - -```text -bindings/common-integrations/go/v0.1.0 -``` - -All new selected module tags are pushed atomically after preflight. Tags are -never moved or force-updated. - -Each module tag has its own GitHub Release. For asset stem -`-go-`, that release contains: - -- `.source.zip`. -- `.module.zip`. -- `.runtimeconditions.binding-model.yaml`. -- `.runtimeconditions.binding-release.yaml`. -- `.runtimeconditions.bindings.yaml`. -- `.runtimeconditions.file-manifest.yaml`. -- `SHA256SUMS` covering the six named artifacts. - -Source archives contain the committed package tree under its repository -subdirectory prefix. Module archives contain it under the native -`@v/` prefix. The root extension resource remains inside the -package archives. - -Releases are created as drafts, populated with verified assets, then made -public. Retries reuse identical tags and assets and upload only missing assets. -A byte mismatch or unexpected asset fails rather than replacing published data. -Publication rechecks `main` before its first remote mutation. - -### 18.4 Public installation checks - -After publication, fresh consumers install each module through both direct -retrieval and `https://proxy.golang.org,direct`. These checks use isolated module -caches, public checksum verification, empty private-module settings, and no -publishing tokens. They run `go get` for the released version and compile an -import that uses the generated package name without an alias. - -Successful installation requires no GitHub credentials, private-module -configuration, local replacement, or source checkout. The public module tag -supplies Go installation; release ZIPs additionally provide downloadable, -checksummed artifacts. - -### 18.5 Operational sequence - -1. Update extension inputs or delivery configuration on `main`. -2. Let automatic generation verify and commit selected Go package trees. -3. Let the documentation build deploy the discovery pages. -4. Dispatch publication with the desired targets and `dry_run: true`. -5. Dispatch with `dry_run: false` after preflight succeeds. -6. Confirm the workflow's fresh public consumer installation checks succeed. - -A failed target is corrected through its inputs and regeneration. Publication -never repairs source or rewrites an existing module version. - -## 19. Consumer example - -Install the published common and environment bindings: - -```sh -go get runtimeconditions.io/x/rc/common@v0.1.0 runtimeconditions.io/x/rc/env@v0.1.0 -``` - -A Go project can declare a Redis cache and environment configuration without -import aliases: - -```go -package main - -import ( - "runtimeconditions.io/x/rc/common" - "runtimeconditions.io/x/rc/env" -) - -func init() { - _ = common.Cache( - common.KeyValue{ - Engine: &[]common.KeyValueEngine{common.KeyValueEngineRedis}[0], - }, - env.KeyValueConfiguration{ - Env: env.KeyValueConfigurationEnv{ - {Name: "REDIS_URL", Property: env.KeyValueConfigurationEnvPropertyUrl}, - }, - }, - ) -} - -func main() {} -``` - -An independently installed compatible Go profiler generates the profile from -the project root: - -```sh -go-rc-profiler generate -dir . -out ./profile.yaml -``` - -The common CLI will expose this profiler operation as `rc profile go generate` -and its Go-default form `rc profile generate`. Both routes use the same -installed profiler and binding resources. - -The resulting profile identifies the complete extension URIs and includes the -cache interface and configuration. Generated declarations do not require the -application to execute in order to extract this information. - -## 20. Safety, determinism, and delivery acceptance - -YAML parsing rejects duplicate keys, non-string mapping keys, custom tags, and -resource-limit violations. Inputs are bounded to 64 MiB, 1,000,000 decoded nodes, -256 nesting levels, and 100 alias references. Normalized outputs contain no -aliases or presentation-dependent identity. - -HTTPS resolution uses certificate validation, a 10-second connection timeout, -a 60-second total timeout, bounded response data, and no redirects. Downloads, -cache entries, package resources, and release assets are verified against the -applicable identities and digests. Credentials are not persisted in artifacts -or included in diagnostics. - -Generation writes only selected generated package directories. Build jobs have -read permissions; the controlled generation commit and publication jobs receive -their required write permissions. Public consumers do not inherit publishing -credentials. - -The implementation is accepted when: - -1. Semantic fixtures and native emitter suites establish deterministic, - extension-independent behavior. -2. Package verification checks schemas, native APIs, provider relationships, - installed tool identities, archives, and regeneration equality. -3. Generation commits only complete verified target updates and fails safely - when `main` advances. -4. Documentation deployment serves definition resources and exact Go discovery - metadata for generated modules. -5. Publication promotes the packaged committed trees, enforces compatible - versions, and preserves immutable module tags and release assets. -6. Fresh public Go consumers retrieve released modules and compile unaliased - imports without private settings or local replacements. -7. The common CLI can expose the binding interface through a thin adapter while - retaining these inputs, outputs, provenance, and failure boundaries. diff --git a/tooling/extension-bindings/PHASE-1.md b/tooling/extension-bindings/PHASE-1.md deleted file mode 100644 index 914e9b0..0000000 --- a/tooling/extension-bindings/PHASE-1.md +++ /dev/null @@ -1,97 +0,0 @@ -# Phase 1 Implementation Record - -Status: complete - -Implementation standard: -`tooling/extension-bindings/IMPLEMENTATION.md` - -## Delivered components - -- A strict semantic input schema for extension definitions. -- A strict schema for `runtimeconditions.binding-model.yaml`. -- Go data types matching the binding-model schema. -- A Go resolver producing deterministic dependency closures and dependency - locks. -- A Go structural normalizer producing language-neutral binding models. -- Canonical semantic hashing using RFC 8785 JSON serialization. -- Canonical YAML serialization for binding models and dependency locks. -- Separation of semantic model identity from source-resolution provenance. -- Dependency-lock validation at the normalization boundary. -- Complete JSON Schema Draft 2020-12 validation for extension schemas and - scoped field values. -- Deterministic vocabulary ownership, scope expansion, structural projection, - value-domain, source-name preservation, provenance, and diagnostic generation. -- A command-line program for resolving an extension closure and writing a - normalized model and separate dependency lock. -- A language-neutral conformance suite with committed expected models and - diagnostics. -- Automated verification configured for Linux and macOS. -- Local usage and artifact documentation in - `tooling/extension-bindings/README.md`. - -## Normalized model contents - -The implemented model records: - -- root extension semantic identity; -- normalizer and core profile schema identity; -- the complete topologically ordered extension closure; -- direct dependency edges; -- vocabulary ownership; -- owned kind declarations; -- kind-scoped interface declarations; -- condition and interface fields expanded to exact scopes; -- parsed field-path segments with explicit array traversal; -- scoped value domains; -- exact JSON Schema documents; -- language-neutral structural projections; -- validation-only constraints; -- semantic provenance; and -- a canonical semantic SHA-256 digest. - -Source-byte digests and resolution transport data are confined to dependency -locks and do not contribute to normalized model bytes or the model digest. - -## Structural normalization coverage - -The implemented structural model covers: - -- objects and required properties; -- string, boolean, integer, number, and null scalars; -- arrays with scalar or object items; -- schema-valued maps; -- scalar enumerations and constants; -- object and heterogeneous unions; -- conjunctive schema composition; -- recursive local JSON Pointer references; -- referenced definitions as named shapes; -- additive schema composition by scope; -- fixed scope metadata removal from caller-facing projections; and -- validation of scoped field paths and declared values. - -Unsupported structure-changing schema constructs produce deterministic -diagnostics before model emission. - -## Verification results - -| Check | Result | -| --- | --- | -| Language-neutral conformance cases | 12 total | -| Positive expected models | 9 exact YAML checkpoints | -| Negative expected diagnostics | 3 exact YAML checkpoints | -| Repeated normalizations per positive case | 100 identical runs | -| Set-order permutations per positive case | 100 identical runs | -| Repository extension definitions normalized | 8 discovered definitions | -| macOS test suite | Passed | -| macOS static analysis | Passed | -| Linux test suite | Passed | -| Linux static analysis | Passed | -| Positive model schema validation | Passed for every positive checkpoint | -| Catalog extension YAML modifications | 0 files | -| Catalog or conformance identifiers in production Go files | 0 occurrences | -| Source-resolution fields in normalized models | 0 occurrences | - -The Linux and macOS test runs compared generated output with the same committed -checkpoint bytes. Repository-wide catalog discovery, dependency ordering, -semantic canonicalization, model serialization, schema validation, and exact -diagnostic comparison all completed successfully. diff --git a/tooling/extension-bindings/PHASE-2.md b/tooling/extension-bindings/PHASE-2.md deleted file mode 100644 index 518ddc4..0000000 --- a/tooling/extension-bindings/PHASE-2.md +++ /dev/null @@ -1,53 +0,0 @@ -# Phase 2 Implementation Record - -Status: complete - -Implementation standard: -`tooling/extension-bindings/IMPLEMENTATION.md` - -## Delivered components - -- A Go emitter consuming only a normalized binding model and one package target. -- Deterministic Go declarations, marker contracts, structs, named scalars, - slices, maps, unions, and string value-domain constants. -- Native `go.mod` metadata with direct extension-package requirements. -- Exported structural marker methods supporting additive packages across direct - and transitive Go module dependencies. -- Generated conformance source covering every emitted declaration, type, field, - value member, collection, map, and union. -- A provisional schema and generated metadata for - `runtimeconditions.bindings.yaml`. -- Deterministic source ZIP construction and undeclared-file verification. -- A command-line program implementing the standard emitter contract. -- Test-only Go package targets for the language-neutral conformance models. -- An exact Go-specific negative fixture for a root field type colliding with an - owned-kind declaration function. -- Automated Go emitter verification on Linux and macOS. - -The test-only package targets are confined to emitter test data. They are not a -production package catalog and do not create committed generated packages. - -## Verification results - -| Phase 2 requirement | Result | -| --- | --- | -| Positive conformance models | 9 emitted and verified | -| Model schema validation | Passed | -| Binding-manifest schema validation | Passed | -| Native package metadata parsing | Passed | -| `gofmt` | Passed | -| Generated package compilation and tests | Passed | -| `go vet` | Passed | -| Generated conformance coverage | Passed | -| Three-run source determinism | Passed | -| Source archive undeclared-file check | Passed | -| Go AST exported-API comparison | Passed | -| Direct additive package composition | Passed | -| Transitive additive package composition | Passed | -| Exact fixed-symbol collision diagnostic | Passed | -| Normalizer regression suite | Passed | - -Phase 2 does not generate expected profiles or perform profile semantic -validation; those gates begin in Phase 4. Production package catalog entries, -committed generated packages, release assembly, and publication remain later -phases. diff --git a/tooling/extension-bindings/PHASE-3-TODO.md b/tooling/extension-bindings/PHASE-3-TODO.md deleted file mode 100644 index bf256f7..0000000 --- a/tooling/extension-bindings/PHASE-3-TODO.md +++ /dev/null @@ -1,146 +0,0 @@ -# Phase 3 Todo List: Python Emitter - -This checklist tracks the Python emitter work required by -`IMPLEMENTATION.md`. That document is the implementation authority; this file -does not replace or amend it. - -## 1. Resolve the Phase 3 contracts - -- [ ] Consume the normalized binding model and one Python target from - `packages.yaml` through the standard emitter command contract. -- [ ] Define the target metadata needed to map the distribution name to the - import-package name. -- [ ] Use the shared `runtimeconditions.bindings.yaml` contract. Validate the - emitted manifest against the available manifest schema for the Phase 3 - gate 2; Phase 4 delivers the structural binding-manifest schema. -- [ ] Define the generated Python package layout and minimum supported Python - version. The minimum MUST be Python 3.11 or later because the standard - requires `StrEnum`; tool versions MUST be pinned in - `toolchain.lock.yaml`. - -## 2. Define the Python type-system mapping - -- [ ] Map normalized string, boolean, integer, number, null, object, array, - map, union, reference, and recursive shapes to Python typing constructs. -- [ ] Define recursive type-alias syntax compatible with the minimum Python - version and `mypy --strict`. -- [ ] Use `str` for JSON object map keys. -- [ ] Preserve requiredness separately from nullability: a required nullable - field remains a required initializer argument; an optional field uses - `T | None = None` as specified by the standard. -- [ ] Define exact scalar annotations and ensure unsupported shapes fail with a - deterministic diagnostic rather than widening to `Any`. -- [ ] Implement the structural marker `Protocol` and cross-package additive - behavior required by Sections 7 and 10.4. - -## 3. Define Python naming and collision behavior - -- [ ] Implement the Python naming rules in Sections 10.1 and 10.4, including - case conversion, keywords, leading numeric tokens, and dunder names. -- [ ] Allocate the complete generated symbol set and detect collisions with - fixed symbols, imported helpers, built-ins, generated classes, aliases, - protocols, functions, fields, enum classes, and enum members. -- [ ] Define deterministic diagnostics for Python-specific naming and - collision failures. -- [ ] Add exact negative fixtures for Python-relevant collision cases. - -## 4. Define generated Python source structure - -- [ ] Choose a module layout within the generated import-package directory and - define its public exports and `__all__` policy. -- [ ] Generate the inert `Declaration` object and declaration functions - required by Section 10.4. -- [ ] Generate frozen, keyword-only dataclasses with deterministic field order, - defaults, and forward references. -- [ ] Generate `StrEnum` value domains with exact serialized member values. -- [ ] Generate aliases, collections, maps, unions, and recursive references - using the Python mappings in Section 10.4. -- [ ] Emit the standard non-editable header in Python source and package - metadata, without timestamps or host-specific paths. - -## 5. Define Python package metadata and resources - -- [ ] Generate deterministic `pyproject.toml` metadata using the pinned build - backend and tool versions from `toolchain.lock.yaml`. -- [ ] Generate `Requires-Python` consistent with the declared minimum version. -- [ ] Generate direct Python binding dependencies using the required - `>=,` interval. -- [ ] Configure package data for `runtimeconditions.bindings.yaml` at the - import-package location required by Section 11. The orchestrator adds - the extension, model, release, and file-manifest resources in a later - phase. -- [ ] Verify packaged resources through `importlib.resources` from an installed - distribution. -- [ ] Include conformance source in the package artifacts as required by the - generated-package contract. - -## 6. Define archive and reproducibility behavior - -- [ ] Build and inspect both wheels and source distributions using the pinned - Python packaging tools. -- [ ] Make archive bytes deterministic for identical inputs and toolchain, - including timestamps, file order, ownership, permissions, and compression - metadata. -- [ ] Verify archive file manifests and reject undeclared files. -- [ ] Verify wheel installation and source-distribution build in clean isolated - environments. -- [ ] Resolve package dependencies through the native Python package manager; - do not scan package caches or filesystems. - -## 7. Implement the Python emitter - -- [ ] Add the Python emitter project under the planned emitter layout. -- [ ] Implement strict model and package-target loading, including duplicate-key - rejection and the required input limits. -- [ ] Implement Python naming and complete-set collision allocation. -- [ ] Implement declaration functions, marker protocols, dataclasses, scalar - types, enums, aliases, arrays, maps, unions, references, and recursive - shapes. -- [ ] Implement direct and transitive dependency imports. -- [ ] Implement binding-manifest generation and validation for the Phase 3 - schema gate. -- [ ] Implement deterministic `pyproject.toml` generation, the standard - emitter command, and wheel/source-distribution build and inspection. - -## 8. Add Python conformance coverage - -- [ ] Emit every positive language-neutral conformance model. -- [ ] Cover owned declarations, interface objects, direct additive fields, and - transitive dependency closure. -- [ ] Cover recursive references, object-only alternatives with - branch-dependent requiredness, and heterogeneous unions. -- [ ] Cover scalar arrays, object arrays, schema-valued maps, and scoped value - domains. -- [ ] Cover Python naming boundaries, keywords, leading digits, Unicode, and - relevant collision cases. -- [ ] Exercise every generated declaration, type, field, enum member, - collection, map, and union in conformance source. -- [ ] Add exact Python diagnostics for every Python-relevant negative model. - -## 9. Satisfy the Phase 3 verification gates - -- [ ] Gate 1: validate the normalized model schema. -- [ ] Gate 2: validate the Python binding manifest schema. -- [ ] Gate 3: parse Python package metadata with native Python packaging tools. -- [ ] Gate 4: pass `ruff format --check`. -- [ ] Gate 5: compile with the minimum supported Python version. -- [ ] Gate 6: pass `mypy --strict`. -- [ ] Gate 7: pass the native Python test suite. -- [ ] Gate 8: verify complete conformance-source coverage. -- [ ] Gate 12: verify byte-identical repeated emission. -- [ ] Gate 14: reject undeclared archive files. -- [ ] Gate 16: compare the exported Python API from the native AST with the API - derived mechanically from the model. -- [ ] Test direct and transitive additive package composition with source - packages and built, installed wheel artifacts. -- [ ] Verify package resources from installed wheels and source distributions. - -## 10. Phase 3 exit review - -- [ ] Confirm no extension YAML was modified. -- [ ] Confirm emitter behavior is not keyed to a conformance identifier, - extension identifier, kind, field, or value. -- [ ] Confirm generated source and metadata contain no timestamps or - host-specific paths and repeated builds are byte-identical. -- [ ] Confirm all applicable diagnostics are deterministic and exact. -- [ ] Record Phase 3 verification results in `PHASE-3.md`. diff --git a/tooling/extension-bindings/PHASE-3.md b/tooling/extension-bindings/PHASE-3.md deleted file mode 100644 index 64a77d3..0000000 --- a/tooling/extension-bindings/PHASE-3.md +++ /dev/null @@ -1,43 +0,0 @@ -# Phase 3: Python binding emitter exit review - -Verified on 2026-10-01 on macOS arm64 with Python 3.11.16 and the pinned -Phase 3 tools in `toolchain.lock.yaml`. This review covers the nine positive -normalized conformance models and four Python-specific negative models. - -## Applicable verification gates - -| Gate | Result | Evidence | -| --- | --- | --- | -| 1: model schema | Pass | Every positive model and each mutated negative model validates with the Draft 2020-12 model schema. | -| 2: binding manifest schema | Pass | Every emitted manifest validates with the provisional shared schema. The fuller structural schema belongs to Phase 4. | -| 3: package metadata | Pass | `tomllib` parses every generated `pyproject.toml`; Python package metadata, dependency requirements, and installed distributions are checked through `packaging` and `importlib.metadata`. | -| 4: formatter | Pass | Pinned Ruff 0.16.9 formats generated source during emission; `ruff format --check` passes for every positive package and the emitter source. | -| 5: minimum-version compilation | Pass | Python 3.11.16 `compileall` passes for every positive package and emitter source. | -| 6: static typing | Pass | `mypy --strict` passes for every generated positive package with direct and transitive provider source packages available for import resolution, and for all emitter source modules. | -| 7: native tests | Pass | The complete Python suite reports 79 passed. | -| 8: conformance coverage | Pass | Native AST checks cover every planned declaration call, object type and field, enum member, collection, map, union variant, and JSON value where used. Direct and transitive additive composition also runs from source and installed wheels. | -| 12: repeated source emission | Pass | Each positive model emits into three new directories; relative file sets and all file bytes match. | -| 14: undeclared archive files | Pass | Tests reject undeclared source, wheel, and sdist entries and altered archive metadata. | -| 16: public API comparison | Pass | Native AST checks compare exports, declaration signatures, marker protocols, dataclass fields and defaults, aliases, and enum values with the normalized-model emission plan. | - -The archive tests also build wheels and source distributions twice for each -positive model and compare their bytes. Clean installation tests verify -`importlib.resources`, `py.typed`, conformance source, source-distribution -rebuilds, and direct and transitive dependency resolution with pip. - -The Python-specific negative fixtures assert exact category, code, coordinate, -JSON Pointer, and message for a reserved built-in, fixed symbol collision, -enum-member collision, and unnameable field. Existing tests also check malformed -inputs, unsupported shapes, package/target mismatches, and output rejection. - -## Exit checks - -- No extension definition YAML was changed during this phase. -- Production emitter source contains no conformance case ID, extension ID, - kind, field, or value special case. Conformance names occur only in test data. -- Generated source and metadata contain no timestamps or temporary output - paths. Three-run package emission and two-run archive builds are byte-identical - for the positive fixtures. - -Verification here was run on macOS. The Phase 4 structural manifest and profile -gates are outside Phase 3; this report does not claim those later gates. diff --git a/tooling/extension-bindings/PHASE-4.md b/tooling/extension-bindings/PHASE-4.md deleted file mode 100644 index e6a5bce..0000000 --- a/tooling/extension-bindings/PHASE-4.md +++ /dev/null @@ -1,127 +0,0 @@ -# Phase 4: structural manifests and installed profiler acceptance - -Review date: 2026-10-04. Status: accepted within the approved local verification scope. - -This review covers the approved structural and release manifests, test-only -package assembly, Go and Python binding generation, and the separately installed -language profilers. It includes the added dependency-only schema case. It makes -no claim about production orchestration, publication, or distribution. - -## Scope and evidence - -- Approved criteria: [IMPLEMENTATION.md](IMPLEMENTATION.md), Sections 11–13 - and Phase 4. The document remains unchanged. -- Shared fixtures: [fixtures/README.md](fixtures/README.md), - [fixtures/conformance.yaml](fixtures/conformance.yaml), and - [model/conformance/cases/13-dependency-schema-only/](model/conformance/cases/13-dependency-schema-only/). -- The root of case 13 owns all vocabulary used by its declaration. Its - dependency owns no vocabulary and supplies the sole `maxLength: 6` constraint. - The positive profile must omit that dependency; the negative must fail its - schema without writing a profile. -- `spec/` is read-only throughout this work. - -## Applicable gate review - -Phase 4 requires gates 1–14 and 16. Gate 15 belongs to production file-manifest -orchestration in Phase 5. The shared checks cover all 14 packages per language, -including the schema-only dependency package with no declaration calls. - -| Gate | Current result | Evidence | -| --- | --- | --- | -| 1: model schema | Pass | All 28 assembled model resources validate; preparation also checks semantic digests and identity agreement. | -| 2: strict manifest schema | Pass | All 28 manifests validate against v1alpha2; Go regression checks reject provisional inventories and stale identities. | -| 3: native package metadata | Pass | Every Go module parses through Go tooling; every Python project and wheel metadata parses and matches its package identity. | -| 4: native formatting | Pass | `gofmt -d` and pinned `ruff format --check` report no differences for all packages. | -| 5: minimum-version compilation | Pass | All Go binding and conformance sources compile with Go 1.22.12; every Python source compiles without execution under Python 3.11.16. | -| 6: static analysis | Pass | Go 1.22.12 `go vet` and strict mypy pass for all generated packages. | -| 7: native regression suites | Pass | The normalizer suite includes all 13 cases and passes, including repeated normalization and permutation checks. The Go emitter suite includes case 13 and its dependency; all 14 model AST checks and 98 Python tests pass. | -| 8: complete conformance coverage | Pass | Native AST checks cover all public surfaces in all 14 packages per language. The prepared consumer inventory covers all 11 Go emitted calls plus one deferred call, and 13 Python emitted calls plus two deferred calls. | -| 9: exact generated profiles | Pass | Both installed CLIs pass all 19 exact positive profiles. The matching v4 Go run records the tested binary's hash in every package release; the Python inputs are byte-identical to its passing run. | -| 10: complete profile validation | Pass | Both installed runs validate the complete closure and omit the schema-only dependency from direct contributors. That dependency still supplies the constraint rejecting the invalid declaration. | -| 11: semantic negatives | Pass | Both installed runs reject all six reviewed negatives, including the dependency-only constraint. The three normalizer negatives also match their exact diagnostics. | -| 12: deterministic source generation | Pass | Three source emissions per model match byte for byte for both languages. | -| 13: required archive resources | Pass | All four fixed resources are present and byte-identical to the assembled resources in every archive. | -| 14: no undeclared archive files | Pass | Exact archive file sets and Python RECORD hashes are checked for all 28 archives. | -| 16: API comparison | Pass | Go and Python native AST surfaces match their normalized-model emission plans for all packages. | - -## Prepared evidence locations - -- Complete, validated assembly recording the repaired Go profiler: - `/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-fixtures-v4-20261004`. - The v3 assembly remains preserved for earlier evidence. Preparation attempts - before v3 are incomplete and are not acceptance inputs. -- Reviewed workloads, expected profiles and diagnostics, installation commands, - and hashes: - `/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-results-v4-20261004/inventory.yaml`. -- Assembly comparison and profiler provenance: - `/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-review-20261004/v4-provenance.yaml`. - Every Go release records profiler SHA-256 - `b2e2aee5e10af47a0e75998d3ac591ee17f2887aaaddeae46405296763bc1444`. - All other generated Go files, all 14 Python wheels, and both languages' - workload sources and expected results are byte-identical to v3. The Go - archive dependency locks change with the release metadata. -- Shared gate evidence: - `/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-review-20261004/evidence-final/gates.yaml`. - Its status is `passed`. Earlier pending reviews remain preserved separately. -- Repeatable shared verification runner: - `/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-review-20261004/run_gates.py`. - It writes evidence in YAML, uses a separate source snapshot for regression/AST - checks, compiles copies of Go package sources, and executes no profiler or - application source. Minimum-version Go test binaries are compiled without - execution; native unit suites run separately with the current Go toolchain. -- Consolidated machine-readable acceptance review and evidence hashes: - `/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-review-20261004/consolidated-review.yaml`. - -## Installed CLI evidence - -- Python: 54/54 checks pass: 19 exact positive profiles, six reviewed negatives, - and 29 supplemental checks. The schema-only dependency contributes no - vocabulary, is omitted from the profile, and still rejects the invalid - declaration. The unchanged Python artifacts permit reuse of this passing run: - `/Users/colacy/code/github.com/runtimeconditions/python-profiler-dependency-schema-acceptance-final-20261004/summary.yaml`. - The Python agent independently verified all 14 wheels, 56 fixed resources, - 50 workload files, 25 expectation files, and the inventory after accounting - for the changed assembly/result paths: - `/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-review-20261004/python-v4-equivalence.yaml`. -- Go v4: all 25 workloads pass: 19 exact positive profiles and six reviewed - negatives. All 14 package releases record the executed profiler's full - SHA-256. The run checks resolved module-cache resources, denies source - checkout reads, and confirms binding source is not executed using an - injected panic canary in a separate derived artifact: - `/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/conformance/phase4-go-matched-provenance-2026-10-04/result.yaml`. - Schema-linked profiler regression tests and `go vet` also pass: - `/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/conformance/phase4-go-matched-provenance-2026-10-04/checks.yaml`. - The earlier v3 result remains preserved as - `behavior-passed-provenance-pending`; it is superseded by this passing v4 run. - -## Case 13 registration and acceptance conclusion - -The user approved the three additional files required to register case 13. -The completed changes are: - -- `normalizer/conformance_test.go`: register the thirteenth case so the complete - suite performs its existing repeated-normalization and permutation checks. -- `emitters/go/conformance_test.go`: include the new positive model and assemble - its dependency first in the existing package checks. -- `model/conformance/expected/13-dependency-schema-only/runtimeconditions.binding-model.yaml`: - retain the reviewed normalizer unit checkpoint. Its synthetic unit-test - normalizer digest is separate from the real executable provenance in the - installable fixtures. - -The checkpoint matches the installable model's structure, coordinates, -constraints, and extension/core identities. Only the unit-test normalizer -provenance and resulting model digest differ. Python's existing parametrized -suite discovers the checkpoint automatically and now covers case 13. - -All applicable Phase 4 gates (1–14 and 16) pass. The installed Go and Python -acceptance evidence, shared package checks, and native regression suites close -the approved Phase 4 scope. The registration changes no production code or -assembled package bytes, so the passing installed CLI runs remain applicable. - -This conclusion covers the tested local environment. Go 1.22.12 compiles every -generated binding and conformance source and passes static analysis; its test -binaries were compiled without execution. Native Go suites execute with the -current Go toolchain, while Python checks use Python 3.11.16. Production -orchestration, publication, distribution, and broader platform qualification -remain outside this acceptance. `spec/` and the implementation standard remain -unchanged. diff --git a/tooling/extension-bindings/Phase-4-final.md b/tooling/extension-bindings/Phase-4-final.md deleted file mode 100644 index 11e2be8..0000000 --- a/tooling/extension-bindings/Phase-4-final.md +++ /dev/null @@ -1,736 +0,0 @@ -# Phase 4 final report and Phase 5 handoff - -Report date: 2026-10-04. - -**Phase 4 is accepted within the approved local verification scope.** All -applicable verification gates, 1–14 and 16, pass. Go and Python reconstruct -complete profiles from installed generated bindings, validate their complete -extension closure, and reject invalid declarations before writing a profile. -There are no remaining blockers in that accepted scope. - -This report consolidates the work across `extensions`, `go-rc-profiler`, and -`python-rc-profiler`. It supplements the concise -[Phase 4 gate record](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/PHASE-4.md). -The [implementation standard](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/IMPLEMENTATION.md) -remains the authority for Phase 5. Earlier phase reports describe historical -contracts and counts; their provisional manifests and incomplete fixture -inventories must not be used as the current integration contract. - -## 1. What acceptance establishes - -| Readiness question | Final result | -| --- | --- | -| Can the profilers work as separately installed CLIs? | Yes. Acceptance invokes installed artifacts against unrelated workloads and dependencies installed by native package managers. | -| Must an end user clone `extensions` or either profiler repository? | No. The profiling inputs are workload source, installed binding packages and their packaged resources, native dependency metadata, and the profiler's bundled schema assets. | -| Do the profilers execute workload or binding code? | No. Static extraction and execution sentinels demonstrate the accepted workflow without application or binding initialization. | -| Are profiles fully validated before output? | Yes. Core structure, extension identities and closure, vocabulary ownership and values, and every applicable closure schema are checked. | -| Are the generated packages production releases? | No. The installed corpus consists of explicitly identified test fixtures with real provenance. | -| Is the entire generation and publication system production-ready? | That claim remains governed by Section 20: all seven phases, released locked tools and profilers, reproducible production releases, and the required workflow and registry evidence. | - -The profilers are functionally ready for the end-user generated-binding -workflow tested here. Production delivery must provide properly built, -released profiler artifacts and generated packages satisfying these contracts. -Phase 4 does not establish that those artifacts have been published or that a -clean `go install` of the Go repository reproduces the tested executable. - -The distinction matters for Phase 5: build on the verified extraction and -validation engines, preserve their installed-package boundary, and supply the -production configuration, orchestration, release identities, and committed -generated source that are still absent. - -## 2. Decisions that constrain future work - -1. The structural binding manifest is the integration contract. Production - behavior must not be reconstructed from the legacy manual SDK mapping - approach or a flat symbol inventory. -2. Each profiler remains in its own repository and uses its language's native - source and package metadata tools. Profiler source must never be embedded in - `tooling/extension-bindings/` or its tooling release. -3. Go and Python are the enabled languages for this work. Other languages were - not implemented or accepted here. -4. Profiles are complete documents, including profile identity, workload - identity, direct extension contributors, and Conditions. Condition-shape - checks alone do not establish acceptance. -5. An emitted profile lists extensions that directly contributed vocabulary. - Validation resolves their full dependency closure, including dependencies - that supply only schemas. -6. Generated native APIs enforce structural types. Full JSON Schema semantics - remain the profiler's responsibility; constructors do not become runtime - validators. -7. Legacy SDK mapping compatibility may be sacrificed when it conflicts with - generated-binding interoperability. Existing compatibility code is not an - authority for the new contract. In Python, use the `profile` command group - for this workflow; the older top-level `generate` route remains separate. -8. The SDK binding-generation page was treated as research and intent for - automation. Updating it was deferred. The implementation standard, current - schemas, and accepted evidence take precedence over its technical examples. -9. Production code must stay driven by semantic coordinates and model data. - Conformance identifiers, vocabulary values, and local repository paths must - not select implementation behavior. -10. The final closure work and this report leave `spec/` unchanged. The protected - implementation standard remains unchanged. A Phase 5 agent - must follow `AGENTS.md` and obtain the exact file-list approval required by - Section 4 before changing more than five files. - -## 3. Work completed during Phase 4 - -### 3.1 Replaced the provisional manifest - -Phase 2 supplied a provisional symbol inventory, and Phase 3 emitted against -that provisional contract. Those records could not tell a profiler how to -reconstruct nested native values at exact model locations. - -The shared -[structural manifest schema](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/model/runtimeconditions.binding-manifest.schema.yaml) -now fixes `apiVersion: runtimeconditions.io/bindings/v1alpha2` and rejects -unknown fields. Both emitters produce it. The required sections are -`generated`, `model`, `extension`, `package`, `declarations`, -`importedMarkerContracts`, `rootBindings`, and `types`. - -| Structural record | Information available to a profiler | -| --- | --- | -| Declaration | Exact model coordinate, owning extension, original source name, native function, and marker contract. | -| Root binding | Declaration coordinate, kind/interface scope, serialized path, native value reference, and interface, vocabulary-field, or schema-field role. | -| Named type | Exact model reference, source/native names, construction form, and declaration contracts implemented by that type. | -| Object field | Its containing type, serialized `sourceName`, native field name, requiredness, and child value reference. | -| Collection or map | Its containing type and exact item/value model reference. | -| Union | Ordered alternatives and their exact native representations and model references. | -| Constant or enum member | Native member name, model reference, and exact literal value. | -| Optional reference | Explicit Go pointer or Python nullable representation, distinct from requiredness. | -| Imported marker | Owning declaration contract and, where applicable, the Python provider package needed to resolve it. | - -`modelRef.coordinate` and `modelRef.jsonPointer` are separate lookup fields. -Fields, elements, members, and variants are children of their containing type; -they do not rely on ambiguous parent-name strings. Native references must -resolve to one type or a permitted builtin. Serialized names survive native -naming transformations, including separator changes, case transitions, -digits, and Unicode. - -Identity checks cover native package identity, model API version and digest, -and root extension ID and digest. JSON Schema validation is followed by -cross-resource checks and reference resolution. The regression suite explicitly -rejects the old symbol inventory, including one relabeled with the new API -version, and rejects stale model or extension identities. There is no accidental -compatibility path for provisional manifests. - -### 3.2 Added the missing shared release contract - -The absence of `runtimeconditions.binding-release.schema.yaml` was a real -integration blocker. Running the emitters against the catalog would not create -that schema: it is a shared contract, not an extension-specific output. - -The -[release schema](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/model/runtimeconditions.binding-release.schema.yaml) -now fixes `apiVersion: runtimeconditions.io/binding-release/v1alpha1` for Go -and Python. It records: - -- package key, language coordinate, native name, version, minimum language - version, and publication mode; -- model API version and semantic digest; -- root extension identity and semantic digest; -- the complete extension dependency lock, including exact source digests, - semantic digests, versions, source backends/locators, and dependency edges; -- direct language-package dependencies, tested versions, compatible intervals, - and artifact kinds/digests; -- either actual `test-fixture` assembly provenance or `production` provenance. - -Fixture provenance requires the real fixture assembler and profiler identities. -Production provenance requires the orchestrator and profiler identities, -`bindings//` source directory, and the matching target -release tag. The latter branch is defined for Phase 5; Phase 4 did not fabricate -production provenance or implement the production orchestrator. - -Schema validity alone cannot prove these equalities. Assembly and both -profilers check agreement with the native dependency graph, normalized model, -packaged extension definitions, and dependency metadata. Source-byte identity -and transport evidence remain outside the semantic model. - -### 3.3 Established the real core-schema prerequisite - -Early conformance models contained a placeholder core-schema digest, and some -structural examples omitted the interface required by the current core draft. -Those inputs could neither establish core validation nor produce accepted -complete profiles. - -The approved -[core schema](/Users/colacy/code/github.com/runtimeconditions/spec/schema/runtimeconditions.profile.v0.2.0.schema.yaml) -is now the pinned contract used by fixture assembly and both profilers: - -| Identity | Value | -| --- | --- | -| Schema ID | `https://runtimeconditions.io/schemas/profile/0.2.0/runtimeconditions.profile.schema.yaml` | -| Version | `0.1.0` | -| Source-byte SHA-256 | `342bf20bce479f5012b9fc2c6238dc1fb0935e327ecb0fbca6e647362563c73c` | -| Semantic SHA-256 | `a090a8016d045f9c3fa872a67f8df293b77ca2809a1bea5ae9fa31a27a06109a` | - -The shared test configuration and expected normalized models reference this -real identity. Go carries approved schema bytes in the installed binary through -its build process; Python carries them as profiler-wheel package data. Neither -installed profiler reads the `spec` checkout. - -Normalizer unit checkpoints still use a deliberately synthetic normalizer -executable digest to remain independent of platform-specific binaries. That -unit-test convention is separate from the core-schema identity. Installable -fixtures are normalized afresh and record the actual executed normalizer's -digest. They contain no placeholder core identity or invented release provenance. - -### 3.4 Corrected conformance inputs and general emitter defects - -- Cases 08 and 09 gained the required interface representation. Cases 06, 07, - 10, and 11 were then corrected so their closed extension schemas admit the - required core `kind` and `interface.type` fields. Their original recursive, - alternative, collection, value-domain, and naming constraints remain. -- Python naming collisions exposed missing canonical parent context. The - allocator now includes the `interface` parent where needed. -- Case 08 also exposed an ambiguous Python manifest lookup: a field named - `target` could replace the interface type associated with the same source - token. Root bindings now use the property's already allocated symbol and - exact structural identity. The correction was reviewed with the complete - Python suite before approval. A negative test now selects its enum by name - instead of relying on the old property position. -- Go schema-derived root field types in cases 06–09 initially lacked the marker - methods and manifest `implements` entries needed by declaration functions. - The general emitter now derives those declaration contracts from the model - and root bindings. Native method-set checks and manifest assertions agree. -- Go conformance samples now satisfy valid numeric domains, construct required - recursive values, and supply one optional object alternative at a time. -- Declaration-only packages retain native function-reference coverage. Complete - calls are supplied by consumer workloads with installed interface/field - providers. A positive case is never counted as accepted merely because its - incomplete declaration was correctly rejected. - -These were corrections to shared conformance fixtures and general algorithms. -They were not changes to real catalog extension YAML or case-specific production -branches. - -## 4. Installed resource contract - -Every generated package must install these four resources together: - -| Resource | Purpose | -| --- | --- | -| `runtimeconditions.bindings.yaml` | Native-to-model structural mapping. | -| `runtimeconditions.binding-model.yaml` | Exact semantic model consumed by the emitter, with core and normalizer identities. | -| `runtimeconditions.extension.yaml` | The validated root extension definition. Dependencies supply their own packaged definitions. | -| `runtimeconditions.binding-release.yaml` | Source lock, dependency artifact identities, and assembly/verification provenance. | - -For Go they are beside the declaration source in the package directory resolved -through Go tooling. For Python they are package data inside the installed -generated import package, owned by its installed distribution. - -Python's profiler locates third-party resources through distribution file -metadata without importing the binding package. Calling -`importlib.resources.files()` on an arbitrary binding-package name can execute -its initialization; the static discovery implementation deliberately avoids -that. Reading the profiler's own trusted bundled resources is a separate use of -`importlib.resources`. - -Resource discovery must remain tied to the imported package and native package -manager. Recursive searches of module caches, site-packages, sibling repositories, -or catalogs are not part of the installed profiling workflow. - -## 5. Go profiler production-oriented implementation - -The [Go profiler interoperability plan](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/GENERATED-BINDINGS-INTEROP-PLAN.md) -and [conformance record](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/CONFORMANCE.md) -document the separate repository's work. The implemented path includes: - -1. Native Go source loading and type information, with package-qualified - declaration recognition rather than guessed names or SDK mappings. -2. Go module download/verification and package resolution, followed by reads of - only the fixed package-local resources. -3. Strict resource-schema validation; package, model, extension, lock, source, - dependency-version, marker, and native-reference consistency checks. -4. Structural value extraction for the generated API: objects, scalars, - constants, arrays, maps, union representations, recursive structures, - pointers, zero values, and optional omission. -5. Direct vocabulary contributor selection and complete installed extension - closure validation against the bundled core and preserved extension schemas. -6. Deterministic YAML output and an atomic file write after validation succeeds. - Unsupported expressions, unresolved values, or invalid declarations fail - instead of becoming guessed accepted Conditions. - -Useful implementation entry points are -[the CLI](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/main.go), -[generated extraction](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/extractor/generated.go), -[native value reading](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/extractor/generated_values.go), -[installed package verification](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/extensioncheck/imported.go), -[release checks](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/extensioncheck/release.go), -and [profile finalization](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/extensioncheck/generated_profile.go). -Structural extraction is implemented; the earlier stub is not the current state. - -The final schema-only dependency fixture exposed one additional resolver defect. -Its dependency was selected by the Go module graph but not imported by source. -The original resolver tried to list it from the workload in a way that required -a `go.mod` edit. The repair uses Go's selected module build list and inspects -the resolved dependency artifact. `TestInstalledValidationOnlyDependency` -preserves that regression. A dependency does not need a source import to -participate in semantic validation. - -The Go release build must include the approved core bytes. The existing -[build script](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/scripts/build-with-core-schema.sh) -checks their source digest and supplies them through linker configuration. -That is producer-side preparation. End users receive the completed executable -and need no schema checkout. A plain build/install that omits this preparation -must not be advertised as the accepted production artifact. - -The profiler repository declares Go 1.25.0; its acceptance ran with Go 1.26.5 -on macOS arm64. Generated binding source was separately checked at Go 1.22.12. -Those are different support statements. The installed profiler uses Go tooling -to resolve and inspect the workload; an appropriate `go` toolchain must remain -available in the end-user or CI environment. - -## 6. Python profiler production-oriented implementation - -The [Python interoperability plan](/Users/colacy/code/github.com/runtimeconditions/python-rc-profiler/GENERATED-BINDINGS-INTEROP-PLAN.md) -and [conformance record](/Users/colacy/code/github.com/runtimeconditions/python-rc-profiler/CONFORMANCE.md) -document the separate repository's work. The implemented path includes: - -1. AST discovery of imported binding symbols and installed distribution ownership. -2. Exact package-data lookup through `importlib.metadata`, including missing or - misplaced resources, ambiguous ownership, and workload-shadowing rejection. -3. Strict YAML parsing, resource limits, bundled schema validation, canonical - digests, installed file-record hashes, package identities, exact closure - edges, compatible dependency intervals, and imported marker verification. -4. Static extraction of generated declaration functions, dataclass-style object - construction, wrapper objects, scoped enum members, sequences, maps, unions, - recursive shapes, and omitted/nullable fields. Application and binding - imports are not evaluated. -5. Core validation, direct vocabulary contributors, complete closure validation, - and all applicable exact extension schemas. Unsupported dynamic authoring, - invalid enum representations, and values outside the binding structure fail. -6. Complete deterministic profile serialization and atomic output after all - validation succeeds. - -Implementation entry points are -[the installed CLI](/Users/colacy/code/github.com/runtimeconditions/python-rc-profiler/runtimeconditions_profiler/cli.py), -[static installed discovery](/Users/colacy/code/github.com/runtimeconditions/python-rc-profiler/runtimeconditions_profiler/project/installed.py), -[artifact verification](/Users/colacy/code/github.com/runtimeconditions/python-rc-profiler/runtimeconditions_profiler/project/verify.py), -[generated extraction](/Users/colacy/code/github.com/runtimeconditions/python-rc-profiler/runtimeconditions_profiler/profile/generated.py), -and [semantic validation](/Users/colacy/code/github.com/runtimeconditions/python-rc-profiler/runtimeconditions_profiler/profile/semantic.py). - -The wheel supplies the console script, the approved core YAML, and the binding -contract-schema bundle. The generated-binding commands are -`runtimeconditions-python-profiler profile verify-bindings` and -`runtimeconditions-python-profiler profile generate`. - -The CLI must run in the Python environment containing the workload's binding -distributions. An isolated CLI environment without those dependencies does not -meet that discovery contract. Python 3.11 or newer is declared; the final installed -CLI acceptance used Python 3.12.10. Binding generation and its minimum-version -checks used Python 3.11.16. The profiler regression run recorded 86 passing tests; -the final Python **emitter** suite recorded 98. These are separate suites. - -Python installation normally does not retain the original wheel archive. -Acceptance hashes the wheel before installation, while the profiler checks -installed RECORD entries and resource/model/extension digests. Phase 5 must -retain this distinction when verifying archives and installed packages; an -installed RECORD check is not a recomputed original wheel-archive digest. - -## 7. What the end-user workflow now supports - -An end user installs a released profiler and the desired generated binding -dependencies through normal language dependency management, writes static -declarations in their workload, and invokes the installed profiler. The -generated dependencies carry the four fixed resources and their closure. - -For a Go workload, the implemented command shape is: - -```sh -go-rc-profiler generate \ - -dir /path/to/workload \ - -name checkout-service \ - -workload-uri https://example.test/checkout-service \ - -workload-version 1.0.0 \ - -out /path/to/output/runtimeconditions.profile.yaml -``` - -For Python, invoke these in the environment containing the binding dependencies: - -```sh -runtimeconditions-python-profiler profile verify-bindings \ - --project /path/to/workload - -runtimeconditions-python-profiler profile generate \ - --project /path/to/workload \ - --name checkout-service \ - --workload-uri https://example.test/checkout-service \ - --workload-version 1.0.0 \ - --out /path/to/output/runtimeconditions.profile.yaml -``` - -These commands require workload paths, not paths into the extension catalog. -Omitting the output option writes the accepted profile to stdout. A binding-only -verification command does not replace generation and complete profile validation. -The examples describe implemented CLI behavior; they do not assert that the -tested local artifacts are available from a public registry. - -### URI resolution and remote delivery - -Extension URI identity and language-package delivery are related but distinct. -The current generated-binding profiler paths resolve extension identities and -definitions from the already verified installed binding graph. They do not -provide a general command to fetch arbitrary extension YAML from a supplied URI. -Their code and acceptance evidence must not be described as proving such a -network resolver. - -The shared resolver/normalizer already owns source resolution. Phase 5 must -expose its supported network-backed mechanisms through production orchestration, -resolve the root and complete closure by their globally resolvable IDs, lock the -exact inputs, and package those definitions for end-user profiling. A valid -installed closure therefore permits profiling without another extension fetch; -the upstream package producer may have obtained its YAML remotely or from a -validated cache. Native package managers retrieve the binding dependencies. - -The current identity authority is the sixth draft and implementation standard: -absolute extension URI IDs are opaque identities, and their schemes determine -resolution. Do not revive the fifth draft's last-colon version splitting or an -HTTP-only restriction in these contracts. The conformance corpus's URNs identify -test inputs resolved through its catalog; they are not evidence of public -HTTPS/OCI extension hosting. No end-user checkout is implied by the producer's -catalog fixtures or builder-side repository access. - -## 8. Fixtures, semantic oracles, and complete coverage - -The limited -[fixture assembler](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/fixtures/assemble.py) -was brought forward to unblock installed integration. It emits **14 Go module -archives and 14 Python wheels**, in dependency order, from ten positive root -cases and their required dependency packages. It adds the exact four resources -at their final locations, checks their schemas and identities, and records real -normalizer, assembler, profiler, extension-source, and dependency-archive hashes. - -Its package order, target conversion, output paths, and local distribution are -test infrastructure. It does not implement a production catalog, generic build -planning, SemVer classification, committed output synchronization, promotion, -or publication. Phase 5 replaces it for production targets while retaining the -corpus for regression tests. - -The reviewed -[conformance inventory](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/fixtures/conformance.yaml) -is the independent semantic oracle. The -[consumer preparer](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/fixtures/prepare_results.py) -materializes complete workloads, expected profile YAML, exact expected errors, -installation commands, direct contributors, dependency closures, and input hashes. -It validates those expectations against the core and applicable closure schemas; -it never derives expected values from profiler output or invokes a profiler. - -The preparer is a Python orchestration script containing a generated Go helper. -That helper uses native Go AST handling/formatting, YAML serialization, and schema -validation to prepare fixture source and expectations. It is not a profiler and -does not perform installed-package discovery or Condition extraction. Its -language mix is confined to test preparation. - -| Case | Coverage and final disposition | -| --- | --- | -| 01 | Owned kind, interface, field, and complete declaration. | -| 02 | Owned declaration plus direct additive package. | -| 03 | Leaf declaration, middle interface, root field, transitive ownership, and complete consumer calls. | -| 04 | Exact normalizer rejection of a dependency cycle; no package/model output. | -| 05 | Exact normalizer rejection of vocabulary ownership conflict; no package/model output. | -| 06 | Recursive local reference and required nested values. | -| 07 | Both valid object alternatives; missing and simultaneous alternatives rejected. | -| 08 | Object and scalar union branches; incomplete object branch rejected. | -| 09 | Arrays, object items, maps, both allowed numeric values; invalid value rejected. | -| 10 | Scoped domains, normalized-name collisions, all reviewed enum members, optional omission; invalid scoped value rejected. | -| 11 | Exact serialized source names, including separators, digits, and Unicode. | -| 12 | Exact normalizer rejection of an unsupported structure-changing keyword; no package/model output. | -| 13 | Schema-only dependency validated without appearing among direct contributors. | - -Each language has **19 positive and six negative workload declarations**. -The inventory accounts for all **11 emitted Go calls plus one completed deferred -declaration**, and **13 emitted Python calls plus two completed deferred -declarations**. Additional positive workloads cover consumers, branch choices, -and values; emitted-call counts and workload counts are intentionally different. - -Failure stages are recorded per language. For example, Go rejects the incomplete -union object structurally, while Python's reviewed failure is at the exact -`oneOf` schema. Both reject an invalid scoped value at vocabulary validation. -Diagnostics name the recorded coordinate/pointers and match after only the -documented workload-path normalization. Native type rejection is not substituted -for proof of a semantic schema failure. - -### The final missing case: a schema-only dependency - -The original 18-positive/five-negative corpus had direct contributors equal to -the full closure in every workload. It could not demonstrate omission of a -dependency that still constrained the Condition. - -[Case 13](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/model/conformance/cases/13-dependency-schema-only/root.yaml) -owns the `job` kind, `process` interface, and `command` field in its root. -Its dependency owns no vocabulary and supplies the applicable `command-limit` -schema with `maxLength: 6`. The root does not duplicate that limit. - -- `dependency-schema-only` emits the root extension ID alone while validating - both installed extensions. -- `dependency-schema-invalid` uses `too-long`. Core and root schemas accept - that Condition; only the dependency's schema rejects it, at - `urn:runtimeconditions:conformance:dependency-schema-only:dependency#schema:command-limit`. - There is no accepted output. - -Case 13 is registered in the normalizer and Go emitter suites. Go assembles its -dependency before the root. Its -[expected normalized checkpoint](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/model/conformance/expected/13-dependency-schema-only/runtimeconditions.binding-model.yaml) -matches the installed model except for unit-test normalizer provenance and the -resulting model digest. Python discovers the checkpoint automatically. Existing -100-run normalization and 100-permutation checks now include it. - -## 9. Acceptance runs and provenance repair - -The full installed tests are distinct from fixture preparation and emitter -tests. Go downloads modules into isolated native caches, then runs the installed -profiler offline with source-checkout reads denied. Workloads contain panic -sentinels, and a separate derived binding artifact contains an initialization -panic; successful profiling proves those code paths were not executed. - -Python installs the profiler and binding distributions by name through a mock -HTTP package index into isolated virtual environments. Workload and binding -execution sentinels, installed-resource checks, and adversarial packages exercise -the actual console entry points. The mock index/proxy substitutes dependency -distribution; the extraction and validation engines are the real profilers. -This establishes native installed-package behavior without production publication. - -| Verification | Final result | -| --- | --- | -| Go installed official corpus | 19 exact repeatable profiles; six exact rejections; 14 packages; complete emitted/deferred coverage; three normalizer negatives. | -| Python installed official corpus | 19 exact repeatable profiles and six exact rejections across 14 distributions. | -| Python supplemental corpus | 29 checks: 16 expected profiles and 13 expected rejections for missing/altered resources, wrong identities, missing dependencies, invalid static authoring, and execution boundaries. | -| Python installed total | 54/54, zero failed and zero pending. | -| Native regression suites | Normalizer passes all 13 cases; Go emitter/profiler suites and static checks pass; final Python emitter suite passes 98 tests. | -| Shared package checks | All 28 packages pass model/manifest schemas, native metadata, formatting, minimum-version compilation, static analysis, structural/API coverage, three-run source determinism, and exact archive resource/file-set checks. | - -Go's resolver repair changed its binary. The v3 fixtures still recorded the -original `46af7aa5…` profiler hash while the passing binary was `b2e2aee5…`. -That behavior-only run was correctly kept at -`behavior-passed-provenance-pending`. - -The official v4 assembly was rebuilt with the repaired binary, then the entire -25-workload installed run was repeated and saved. **All 14 Go releases now -record the exact hash of the executed profiler.** Only Go release metadata and -the dependent Go archive locks changed; the other generated Go files were -unchanged. - -All 14 Python wheels were byte-identical to the previously passing assembly. -The Python agent independently verified those wheels, all 56 fixed resources, -all 50 workload files, all 25 expectation files, and the inventory after replacing -only assembly/result paths. Its 54/54 evidence therefore applies to v4 without -re-running identical artifacts. Earlier runs remain preserved. - -The final registration changes touched tests and the new checkpoint. They -changed no production source or assembled package bytes. A fresh shared gate -run passed, closing the remaining normalizer inventory failure and gate 7. - -### Recorded profiler artifact identities - -| Artifact | Accepted identity | -| --- | --- | -| Go profiler executable | SHA-256 `b2e2aee5e10af47a0e75998d3ac591ee17f2887aaaddeae46405296763bc1444` | -| Python profiler wheel, version 0.1.0 | SHA-256 `1a845ba0edd27eb02d877b7acd001878cf5b587b3fba36143eb7b6dfd19abbf6` | - -These identify local acceptance artifacts. The Go build information records a -modified working tree. Do not treat these hashes as evidence that released -toolchain artifacts already exist, or copy them into a production release lock -while claiming they identify released tools. - -### Runtime and platform qualification - -| Check | Environment | -| --- | --- | -| Go installed CLI and native Go suites | Go 1.26.5, macOS arm64. | -| Minimum Go generated-source checks | Go 1.22.12 compilation, conformance-test compilation, and `go vet`. The produced test binaries were not executed. | -| Python binding minimum checks and final emitter suite | Python 3.11.16 with pinned build/format/type/test tools. | -| Python installed profiler acceptance | Python 3.12.10. | - -Cross-platform installed acceptance, Go minimum-toolchain test execution, and -Python installed-CLI acceptance on every declared supported interpreter are not -established by this local run. Release qualification must retain that distinction -instead of inheriting broader support claims from the declared minimum versions. - -## 10. Evidence and how to continue verification - -| Evidence | Location | -| --- | --- | -| Human gate review | [PHASE-4.md](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/PHASE-4.md) | -| Final consolidated YAML, identities, hashes, and accepted scope | [consolidated-review.yaml](/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-review-20261004/consolidated-review.yaml) | -| Final shared commands, outputs, package/archive hashes | [evidence-final/gates.yaml](/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-review-20261004/evidence-final/gates.yaml) | -| Current complete assembly | [v4 fixture tree](/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-fixtures-v4-20261004) | -| Current workloads, oracles, commands, and inventory | [v4 inventory](/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-results-v4-20261004/inventory.yaml) | -| Go matching-provenance installed run | [result.yaml](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/conformance/phase4-go-matched-provenance-2026-10-04/result.yaml) and [regression checks](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/conformance/phase4-go-matched-provenance-2026-10-04/checks.yaml) | -| Python complete installed run | [summary.yaml](/Users/colacy/code/github.com/runtimeconditions/python-profiler-dependency-schema-acceptance-final-20261004/summary.yaml) | -| Python durable inputs/results archive | [acceptance bundle](/Users/colacy/code/github.com/runtimeconditions/python-profiler-dependency-schema-acceptance-bundle-20261004.tar.gz) | -| Independent Python v4 comparison | [python-v4-equivalence.yaml](/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-review-20261004/python-v4-equivalence.yaml) | -| Assembly comparison | [v4-provenance.yaml](/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-review-20261004/v4-provenance.yaml) | - -The primary final review and summaries are YAML. Historical detailed Python -results and earlier Go bundles include JSON evidence; those preserved files do -not establish an alternative production interchange format. New Runtime -Conditions manifests, checkpoints, indexes, and verification evidence must -follow the standard's YAML rule. - -The assembly, results, runners, and some artifacts are outside the `extensions` -repository. Local paths, especially `/private/tmp` executables and virtual -environments, must not be assumed to exist on another host. Preserve or transfer -the evidence bundles and rebuild inputs when needed. Early failed assembly -attempts and the v3 Go provenance-pending run are not replacements for the -accepted v4 inputs. - -For a fresh producer-side replay, follow the pinned dependencies and commands in -[the fixture README](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/fixtures/README.md): - -```sh -python3 tooling/extension-bindings/fixtures/assemble.py \ - --python /path/to/pinned-fixture-python \ - --go-profiler /path/to/schema-equipped-go-profiler \ - --python-profiler-wheel /path/to/runtimeconditions_profiler-0.1.0-py3-none-any.whl \ - --output /path/to/new-fixtures - -python3 tooling/extension-bindings/fixtures/prepare_results.py \ - --fixtures /path/to/new-fixtures \ - --output /path/to/new-results -``` - -Run these from the builder's `extensions` checkout, using new output directories. -That checkout is a build/test input and must stay outside profiler runtime inputs. -The installed Go replay runner is -[run.py](/Users/colacy/code/github.com/runtimeconditions/go-rc-profiler/conformance/phase4-go-matched-provenance-2026-10-04/run.py); -the Python runner is -[run_phase4_acceptance.py](/Users/colacy/code/github.com/runtimeconditions/python-profiler-cli-acceptance/run_phase4_acceptance.py). -Their recorded invocations and inventories give the exact commands, environment, -resource hashes, and required oracles. The -[shared gate runner](/Users/colacy/code/github.com/runtimeconditions/phase4-dependency-schema-review-20261004/run_gates.py) -uses a separate source snapshot and compiles copies of package source; it runs -no profiler or application source. - -If a profiler changes, build its actual artifact first, assemble new fixtures -with that identity, prepare new consumers, and repeat the installed acceptance. -Matching behavior against packages that record another profiler hash is not a -completed provenance check. Reuse prior evidence only after recording exact -artifact and workload/expectation equivalence. - -## 11. Starting state and required work for Phase 5 - -### 11.1 What exists and what is still absent - -| Component | Starting state | -| --- | --- | -| Shared semantic resolver and normalizer | Implemented in Go; preserve their model/lock separation and resolution rules. | -| Go and Python emitters | Implemented with strict structural manifests and accepted conformance coverage. | -| Shared binding-release schema | Implemented, with distinct fixture and production branches. | -| Separately installed profilers | Implemented and accepted for the generated-binding workflow above. | -| Fixture assembly and semantic oracles | Implemented as test infrastructure; reusable as regression inputs. | -| `packages.yaml` | Not present. Production configuration must be introduced. | -| Production `orchestrator/` | Not present. Its Go implementation and `rc bindings` integration are Phase 5 work. | -| Package-catalog, toolchain-lock, and file-manifest schemas listed in Section 4 | Not present in `model/`; create them for the production contracts. | -| `toolchain.lock.yaml` | Exists with `status: phase3-development` and pinned Python build tools. It is not the required complete released-tool/profiler lock. | -| Committed `bindings//` trees | Not delivered by Phase 4. Test package targets are not the production catalog. | -| Production release/promotion/registry workflows | Outside this phase; follow Phases 6 and 7 and their approval boundaries. | - -### 11.2 Production identity and schema-distribution prerequisites - -Before recording production provenance: - -1. Release the required tooling and schema-equipped profilers, then pin their - real versions and artifact SHA-256 values. Do not use workspace binaries - while claiming released-toolchain provenance. -2. Retain the approved core schema bytes and identity in profiler releases. - Make the Go build's core-schema preparation part of its release process. -3. Make contract-schema distribution and drift checks repeatable for the - independently released profilers. Go currently embeds checked-in YAML copies; - Python ships a JSON representation bundle as a profiler implementation asset. - At this report date, all four Go copies byte-match the authoritative schemas - and the Python representations match semantically. Synchronization is still - manual; [FUTURE_WORK.md](/Users/colacy/code/github.com/runtimeconditions/extensions/tooling/extension-bindings/FUTURE_WORK.md) - records the follow-up. Installed validation must remain self-contained. -4. Reconcile emitter artifact-digest recording with Section 2 before production - release. The current strict manifest's `generated` object records emitter - name/version but has no emitter artifact-digest field. The standard requires - that digest. This is an observed production-contract gap, not an implemented - capability. Adding an unknown field to strict v1alpha2 is not compatible; - review the versioned schema, emitter, profiler, and migration implications - before changing the contract. This report makes no such change. -5. Keep emitter diagnostic-code standardization visible. The current Python - `RCP` codes and Go `RCG` codes are tested, but their cross-language ownership - and stability policy remain documented follow-up work. Do not silently - reinterpret matching numbers as matching semantics. - -### 11.3 Recommended implementation order - -1. **Read the authority and define the edit scope.** Start with implementation - Sections 2–7, 10–15, 17–20, this report, the current schemas, and accepted - evidence. Obtain Section 4 approval for the exact Phase 5 file list. -2. **Define and validate production configuration.** Introduce `packages.yaml` - and its schema, the complete toolchain lock and its schema, and the - file-manifest schema. Package configuration owns delivery metadata only; - it must not duplicate extension vocabulary, schemas, or dependency semantics. -3. **Implement Go orchestration behind the global `rc` CLI.** The required - commands are `rc bindings resolve`, `normalize`, `generate`, `verify`, - `package`, `plan-release`, `check`, and `update`. These are Phase 5 command - contracts, not commands implemented by the fixture assembler. -4. **Plan the real dependency graph.** Resolve configured root IDs and closures, - validate exact locks, map extension dependencies to configured language - targets, and build each language's package dependencies before dependents. - Include schema-only dependencies that have no source import or vocabulary - contribution. Do not carry forward the fixture assembler's hardcoded case list. -5. **Generate and assemble production trees.** Reuse the normalizer and native - emitters. Add the exact model, validated root definition, production release - metadata, and deterministic file manifest. Preserve the emitter's source, - package metadata, structural manifest, conformance source, and expected - profile values. Do not introduce source-resolution data into the semantic - model or source headers. -6. **Verify through installed native packages.** Preserve gates 1–14 and 16 and - implement gate 15. Package and install artifacts into isolated consumer - environments, invoke the released locked profilers, compare complete exact - profiles and required failures, and check all file digests and archive entries. - Source-based tests alone are insufficient for this boundary. -7. **Implement compatibility and build planning.** Derive native API surfaces - through ASTs; compare prior release models, behavior manifests, direct - dependencies, and language versions. Apply Section 14's SemVer rules and - treat unprovable schema compatibility as breaking. Resolve previous releases - automatically. Handle ecosystem major-version coordinate changes and - regeneration of dependents. -8. **Implement committed-output operations.** Generate every configured target - regardless of publication mode under `bindings//`. - `check` compares without changing committed source; `update` atomically - replaces only selected target trees and removes stale generated files. - `package` must reproduce and verify the committed tree, then package those - exact bytes. Archives and compiled outputs are not committed source. -9. **Apply Section 15's filesystem contract.** Default cache/work behavior leaves - no persistent intermediate tree. Explicit caches are content-addressed and - every reused object is digest-checked. Tool-required files use invocation-local - temporary directories outside generated targets, cleaned on return. Host - paths and timestamps must not affect persisted output. Emit YAML machine - summaries and concise human summaries. -10. **Prove Phase 5 exit criteria.** Perform a clean full build from an empty work - directory, repeat it with zero generated-source diff, prove packaged-source - equality with committed trees, verify dependency order and exact archive - contents, and execute supported network-backed resolution locally. All 16 - gates must pass for every target. - -The production tag must match -`bindings///v..` and the committed -source directory. Native package source metadata, production release metadata, -and later promotion must agree on that source and release identity. - -Phase 5 must keep the complete positive and negative corpus, schema-only -dependency case, exact serialized names, marker contracts, no-execution checks, -and provenance equality as regressions. It must also establish the support -matrix appropriate to the released profilers rather than expanding the local -acceptance claims in this report by assumption. - -## 12. Final handoff conclusion - -Phase 4 supplied the missing structural and release contracts, real core-schema -integration, complete installable fixtures and independent profile oracles, -general emitter corrections, and functioning separately installed Go and Python -profilers. The final matching-provenance Go run, complete Python run and artifact -equivalence review, and passing shared regression/package gates are preserved. - -Phase 5 can now implement production orchestration using this accepted -integration boundary. Its remaining work is concrete: production configuration -and locked release identities, contract/release prerequisites above, dependency -planning, deterministic assembly and file manifests, installed verification, -version classification, committed output synchronization, and all 16 gates. -It must preserve the end-user experience already demonstrated: install normal -dependencies and a self-contained profiler, profile static workload source, -receive a completely validated profile, and require no source checkout of this -repository ecosystem. diff --git a/tooling/extension-bindings/Phase-5.md b/tooling/extension-bindings/Phase-5.md deleted file mode 100644 index 61a91ff..0000000 --- a/tooling/extension-bindings/Phase-5.md +++ /dev/null @@ -1,129 +0,0 @@ -# Phase 5: binding generation and delivery foundation - -Report date: 2026-10-07. - -The shared binding-generation mechanism is implemented for Go and Python. It -successfully generated and verified bindings for `env-configuration` and its -dependency, `common-integrations`. Future extensions enter through their -definitions and package delivery configuration; extension identifiers and -vocabulary never select implementation code paths. - -## 1. Deliberate limits on complexity - -Early decisions deliberately avoided over-engineering: one shared pipeline, -Go's standard `flag` package, existing native package builders, and independently -installed profilers. Cobra and a broader CLI redesign were deferred. Work stayed -inside `extensions/`; the profiler repositories remained independent. - -We deliberately avoided writing **1,448 redundant conformance files** merely to -repeat the same proofs across existing extensions. No such corpus was added to -the repository. We retained 13 synthetic cases, six authored profiler consumers -across both languages, and focused regression tests. Bugs exposed by new -real-world cases become small, shared tests. - -Production package output contains native source, package metadata, four YAML -resources, and a file manifest. Generated conformance trees, expected-profile -files, and Python `_conformance.py` are excluded. Scratch builds and local -previews live in the ignored `phase5-work/` directory. The abandoned bulk file -plan and stray test output under `bindings/` were removed. - -## 2. Configuration and provenance contracts - -- Added generic schemas for the package catalog, toolchain lock, and file - manifest. `packages.yaml` contains delivery metadata only; definitions and - normalized models supply extension meaning and dependencies. -- Added the emitter SHA-256 identity to both binding emitters' manifests. - Verification rejects missing, malformed, or mismatched emitter digests and - checks agreement among source, model, package, and tool identities. -- Kept fixture provenance separate from the release assembly contract. - Development uses workspace tools and records their actual identities. -- Removed normalizer calls to deleted profiler identity helpers, restoring - ordinary Go builds without profiler source coupling or temporary overlays. - -## 3. Eight commands over one pipeline - -The Go orchestrator implements all eight `rc bindings` commands: - -| Command | Purpose | -| --- | --- | -| `resolve` | Resolve and validate the extension closure and dependency lock. | -| `normalize` | Produce the canonical binding model. | -| `generate` | Generate selected package trees into a separate output directory. | -| `verify` | Check package structure, mappings, identities, native tooling, and reproducibility. | -| `package` | Compare regeneration with committed source, then verify and package that source. | -| `plan-release` | Compare prior releases, schemas, native APIs, behavior, and dependencies for version planning. | -| `check` | Regenerate, verify, and detect committed-source drift. | -| `update` | Verify regeneration and atomically synchronize selected source trees, removing stale files. | - -Dependency planning derives edges from resolved extension closures, including -schema-only dependencies. Providers build first. Assembly adds the extension -definition, binding model, binding manifest, release metadata, and file manifest; -existing native builders produce deterministic archives. Temporary intermediates -are cleaned unless explicitly retained. - -## 4. Shared fixes discovered during implementation - -- Combined alternative string constants at the same field path into one value - domain, eliminating normalizer union collisions. -- Allowed configured Go versions from 1.22 and Python versions from 3.11; - verification still requires the catalog's exact compiler or interpreter. -- Fixed Python's unconstrained array-item lookup so it preserves the parent - array entry. -- Fixed duplicate Python class emission for already-expanded definitions while - preserving recursive references and schema-only packages. -- Made Python condition fields use combined scope projections. Fields supplied - by shared schemas, including `name`, `required`, and `sensitive`, now appear - alongside scoped property domains. Manifest mappings use those complete - projections too. - -The last two fixes gained synthetic regression tests. Existing mutated test -models were updated to keep schema and scope projections consistent. - -## 5. Successful generation for two extensions - -The first reviewed case uses `env-configuration:v1alpha1`, whose declared -dependency is `common-integrations:v1alpha1`. Both received Go and Python catalog -entries. Dependency requirements were derived automatically in both languages. - -| Extension | Go files | Python files | -| --- | ---: | ---: | -| `common-integrations` | 7 | 10 | -| `env-configuration` | 7 | 10 | -| **Total** | **14** | **20** | - -The **34 package files** are local development previews under -`phase5-work/previews/env-configuration-review/bindings/`. This case exercises -dependency ownership, recursive schemas, configuration alternatives, and scoped -value domains through the same generic pipeline. - -## 6. Verification recorded - -- Go normalizer, emitter, CLI, and orchestrator suites passed during this work. -- The latest Python suite passed **118 tests**; strict type checking passed for - all nine emitter source modules. -- All four preview targets passed package verification: dependency installation, - native formatting/build/static analysis, exact model mappings, provenance, - file digests, archive inventory, and deterministic regeneration. -- Synthetic consumers cover profile extraction and rejection of constraints - supplied by schema-only dependencies. Release/network cases use mocked inputs - or local test servers. - -Per-package reports identify `scope: package-structure`. Gates 7–11 are marked -`not-applicable`; their mechanism coverage belongs to the shared tooling suite. - -## 7. Agreed delivery path - -Local previews provide the output review. The next automation work is: - -1. A manually triggered GitHub Actions workflow generates bindings, commits them - to a bot branch, and opens a review PR. -2. Read-only PR checks compare regeneration with committed source and verify the - reviewed packages. -3. After merge, Actions builds packages from that commit. Protected approval - promotes the exact built artifacts without rebuilding them after approval. - -These workflows are planned, not implemented here. The current toolchain lock -remains a development lock; production pinning requires actual released tools -and artifact digests. PyPI organization approval remains pending, and the Python -profiler has not been published to PyPI. Registry publication remains separate -from this local generation result. diff --git a/tooling/extension-bindings/Phase-6.md b/tooling/extension-bindings/Phase-6.md deleted file mode 100644 index bdd05a8..0000000 --- a/tooling/extension-bindings/Phase-6.md +++ /dev/null @@ -1,47 +0,0 @@ -# Phase 6: automatic generation into main - -## Scope approved on 2026-10-07 - -The repository owner directed GitHub Actions to generate extension binding files -and commit them directly to `main`. This supersedes manual generation and the -generation review PR described in the earlier handoff. Package distribution is -deferred to the next phase. Go is enabled first; Python remains disabled until -the Python profiler build is fixed in its own repository. Work is confined to -`extensions/`, and profiler source is not inspected, embedded, or modified here. - -## Implementation - -- `binding-generate.yml` runs on relevant pushes to `main` and manual dispatch. -- Automatic selection initially covers `common-integrations:go` and - `env-configuration:go`, the verified Phase 5 pair. The optional repository - variable `BINDING_GENERATION_TARGETS` and manual input accept comma-separated - `package-key:go` keys or `all` for the full configured Go catalog. -- The runner installs the catalog's exact Go compiler, a checksummed released - Go profiler binary, and a checksummed core schema snapshot. It builds generation - tools from this repository's workspace source and records their real identities. -- The existing `rc bindings update` pipeline verifies generation before replacing - selected generated source trees. Shared tooling tests retain conformance coverage. -- The helper commits only selected generated Go source directories, includes stale - file removals, and leaves unchanged output without a commit. -- Runs are serialized, and the helper rejects a changed `main` head before staging. - The final ordinary Git push also rejects concurrent divergent updates. -- The workflow uses the repository token and reports its result in the Actions - summary. It creates no tags, release assets, or registry publications. - -The workflow requires branch rules that allow the Actions bot to push to `main`. -The full catalog currently stops at `aws-s3:go`, whose local definition still -uses legacy `metadata.id` rather than the root requested by the package catalog. -Automatic selection can expand after the selected definitions resolve and verify. -Enabling Python later requires a working independently installed profiler artifact -and corresponding runner provisioning and tests inside this repository. - -The protected `IMPLEMENTATION.md` is unchanged. Production release toolchain pins and -distribution remain pending. - -## Local verification - -The seven helper tests, actionlint, and the Go normalizer, emitter, and orchestrator -suites passed. The initial pair passed generation and native package verification; -a second run produced identical bytes across all 14 generated Go files. Rehearsal -outputs stayed in the ignored `phase5-work/` checkout. No workflow has been -dispatched and no generated commit has been pushed to GitHub during this work. diff --git a/tooling/extension-bindings/README.md b/tooling/extension-bindings/README.md index 7472a9d..bb2b254 100644 --- a/tooling/extension-bindings/README.md +++ b/tooling/extension-bindings/README.md @@ -1,7 +1,8 @@ # Extension binding tooling -`IMPLEMENTATION.md` is historical design guidance; the repository owner's -standing overrides govern generation and publication. +The original implementation standard and the phase records were removed from +this folder and remain in git history. The repository owner's standing +overrides, recorded below, govern generation and publication. The shared Go resolver and normalizer feed native Go and Python emitters. Native TypeScript and Java emitters live under `emitters/typescript/` and `emitters/java/`. The Go orchestrator exposes eight commands through Go's standard `flag` package. @@ -83,8 +84,8 @@ the workflow explicitly dispatches the existing docs build using On 2026-10-07, the repository owner explicitly directed Phase 6 to generate and commit bindings to `main`, replacing the manual generation and review-PR path. -That direction supersedes the relevant delivery steps in `IMPLEMENTATION.md`; -the protected document remains unchanged. Phase 5's shared +That direction supersedes the relevant delivery steps in the original +implementation standard. Phase 5's shared conformance verification decision remains in effect. ## Go binding publication @@ -340,8 +341,8 @@ released tooling lock is optional future work. ## Phase 5 verification scope On 2026-10-06, the repository owner explicitly overruled the per-target -conformance requirement in `IMPLEMENTATION.md`. The protected baseline remains -read-only. This decision replaces Section 13 gates 8–11 for production packages +conformance requirement in the original implementation standard. This decision +replaces that standard's Section 13 gates 8–11 for production packages and moves generated-package unit exercises (gate 7) into the shared tooling suite. The generation mechanism is tested against the existing 13 synthetic cases for From 0c2cb9446459176ea7adc21d8205cbf2e1f0085e Mon Sep 17 00:00:00 2001 From: vvardan007 <141992422+vvardan007@users.noreply.github.com> Date: Wed, 2 Dec 2026 19:03:09 +0530 Subject: [PATCH 2/2] Remove README notes about the removed implementation standard --- tooling/extension-bindings/README.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tooling/extension-bindings/README.md b/tooling/extension-bindings/README.md index bb2b254..7504dba 100644 --- a/tooling/extension-bindings/README.md +++ b/tooling/extension-bindings/README.md @@ -1,8 +1,5 @@ # Extension binding tooling -The original implementation standard and the phase records were removed from -this folder and remain in git history. The repository owner's standing -overrides, recorded below, govern generation and publication. The shared Go resolver and normalizer feed native Go and Python emitters. Native TypeScript and Java emitters live under `emitters/typescript/` and `emitters/java/`. The Go orchestrator exposes eight commands through Go's standard `flag` package. @@ -82,12 +79,6 @@ separate from the Python tooling environment used for generation. After a succes the workflow explicitly dispatches the existing docs build using `DOCS_REPO_DISPATCH_TOKEN`, including when no generated commit was needed. -On 2026-10-07, the repository owner explicitly directed Phase 6 to generate and -commit bindings to `main`, replacing the manual generation and review-PR path. -That direction supersedes the relevant delivery steps in the original -implementation standard. Phase 5's shared -conformance verification decision remains in effect. - ## Go binding publication Go bindings are public modules, installable without credentials or private-module @@ -340,11 +331,6 @@ released tooling lock is optional future work. ## Phase 5 verification scope -On 2026-10-06, the repository owner explicitly overruled the per-target -conformance requirement in the original implementation standard. This decision -replaces that standard's Section 13 gates 8–11 for production packages -and moves generated-package unit exercises (gate 7) into the shared tooling suite. - The generation mechanism is tested against the existing 13 synthetic cases for schema shapes, naming, dependencies, unsupported input, and determinism. Native API exercises are temporary test consumers. Network and previous-release