Skip to content

VAL-C1b: Validation Capability 1 Vertical Slice #681

Description

@owleyeview

VAL-C1b: Commit validation integration and rejection surface

1. Summary (Required)

What is the enhancement?

Complete Capability 1 by integrating the VAL-C1a validator with public Commit. Commit will assess
the complete Nursery before any persistence write, reject semantic violations without writing, and
return a typed rejection response whose per-holon findings remain available through the staged pool.

This issue adds the CommitResponse rejection surface, Nursery orchestration, and the
assess → plan → write Commit structure. It preserves existing success and operational-failure
behavior.


2. Problem Statement (Required)

Why is this needed?

VAL-C1a delivers active validation bindings, handlers, reports, and clean corpus conformance, but
nothing invokes that validator during production Commit.

The current guest Commit immediately begins its two persistence passes. Once the first node is
written, semantic rejection can no longer guarantee zero writes. The current response also
distinguishes only Complete and Incomplete, conflating semantic refusal with operational
persistence failure.

Capability 1 is not a vertical slice until public Commit:

  • validates every staged holon on every attempt
  • rejects findings before persistence
  • keeps rejected transactions open for correction
  • reports rejection distinctly from abandonment and operational failure
  • preserves findings through the existing staged-holon wire path

3. Dependencies (Required)

Does this depend on other issues or features?

Does not depend on: Capability 2. VAL-C1b completes the Capability 1 vertical slice using only
the cohort delivered by VAL-C1a.


4. Proposed Solution (Required)

How would you solve it?

4.1 Add Nursery validation orchestration

Add the holons_validation entry point over a complete Nursery and invoke it from the single
production guest Commit path.

Each Commit attempt must:

  • assess every staged holon regardless of prior ValidationState
  • replace validation state and findings together
  • preserve operational errors separately
  • return CommitValidationReport for completed semantic assessment
  • return Err(HolonError) when assessment cannot complete reliably

CommitValidationReport remains guest-internal, unbound, and unserialized.

4.2 Gate the existing Commit persistence path

Invoke Nursery validation before entering either existing persistence pass.

If assessment produces findings:

  • reject the complete persistence-candidate set;
  • do not invoke node or SmartLink persistence;
  • retain staged candidates and their replacement findings;
  • leave the transaction Open; and
  • return CommitRequestStatus = Rejected.

If assessment succeeds, continue through the existing two-pass Commit implementation. Preserve its staged-state transitions, relationship snapshot-and-drop-lock discipline, SmartLink behavior, and operational partial-write semantics.

This issue does not introduce a first-class Commit persistence plan or otherwise restructure node and relationship persistence. The Nursery and its StagedHolon states remain the authoritative Commit workset. This issue adds a validation gate over that workset before the existing persistence passes; it does not introduce a second, separately materialized Commit-plan representation.

4.3 Add the Commit rejection schema surface

Update schema-src/dance/schema.tdl with:

  • Rejected in CommitRequestStatus.MapEnumValueType
  • RejectedHolons / RejectedByCommit
  • ValidationViolationCount.PropertyType using MapInteger

RejectedHolons contains staged holons associated with findings. The count is derived from the
in-memory report.

Do not add ValidationReport.PropertyType or serialize the report. Per-holon findings travel with
the staged pool already exported as session state.

Regenerate generated/json-imports/dance/schema.json and affected operational
bootstrap/resource projections through map-schema.

4.4 Propagate rejection status

Add the corresponding type-name constants and update existing status consumers:

  • TransactionContext::should_transition_from_commit_response
  • LoadCommitStatus.MapEnumValueType
  • the loader’s Rust LoadCommitStatus
  • loader response construction and summaries
  • the Sweettest Commit executor

Rejected means assessment completed and persistence was refused. It must not be treated as
Incomplete, Skipped, Abandoned, or an unexpected status.

4.5 Add end-to-end demonstrations

Through the public Commit path, demonstrate:

  • an accepted Nursery persists and returns Complete
  • a missing required property returns Rejected before any write
  • inherited family-root bindings are active without local bindings
  • rejected holons retain identity-only findings in the returned staged pool
  • correction followed by another Commit replaces stale findings and can succeed
  • operational persistence failure remains Incomplete
  • canonical Core bootstrap remains accepted

5. Scope and Impact (Required)

What does this impact?

Modified:

  • happ/crates/holons_guest/src/guest_shared_objects/commit_functions.rs
  • holons_validation Nursery orchestration
  • TransactionContext Commit status handling
  • schema-src/dance/schema.tdl
  • schema-src/core/loader-types.tdl
  • generated dance, loader, bootstrap, and resource projections
  • type_names property and relationship identities
  • Holon Loader Commit-status handling
  • Sweettest Commit/loader executors and fixtures

Out of scope:

  • Capability 2 descriptor and affected-Schema rules
  • value constraints beyond native-kind compatibility
  • relationship/cardinality validation
  • transaction-wide finding representation
  • serialized validation reports
  • persistence atomicity or rollback
  • Commit ingress convergence outside the existing public path
  • holon deletion

Behavioral impact: public Commit can now reject semantically invalid staged state before writing.


6. Testing Considerations (Required)

How will this enhancement be tested?

Unit tests:

  • Nursery orchestration assesses every staged holon on every pass
  • accepted, rejected, and assessment-error outcomes remain distinct
  • validation state and findings are replaced while operational errors are preserved
  • Rejected does not transition the transaction from Open
  • Complete still transitions normally
  • response violation count is derived from the report
  • loader maps Rejected without converting it to Incomplete or Skipped

Sweettests:

  • accepted Commit writes nodes and SmartLinks
  • rejected Commit performs zero writes
  • rejected transaction retains staged candidates and findings
  • corrected retry succeeds and clears stale findings
  • RejectedHolons identifies finding-bearing staged holons
  • findings arrive through the returned staged pool
  • operational failure remains Incomplete
  • canonical bootstrap remains clean with all seven bindings active

Run:

  • npm run fmt:check
  • npm run check
  • npm run test:unit
  • npm run sweetest (maintainer-run under Nix)

7. Definition of Done (Required)

When is this enhancement complete?

  • Public Commit invokes the VAL-C1a validator over the complete Nursery on every attempt.
  • Public Commit completes Nursery assessment before invoking any existing node or SmartLink persistence operation.
  • Semantic rejection performs zero persistence writes and leaves the transaction open.
  • Rejected staged candidates retain replacement validation state and findings.
  • Accepted Commit behavior and existing relationship lock discipline are preserved.
  • Operational assessment errors remain HolonError; persistence failures remain Incomplete.
  • CommitRequestStatus includes Rejected.
  • RejectedHolons / RejectedByCommit and derived ValidationViolationCount are implemented.
  • No serialized validation-report property is added.
  • LoadCommitStatus and all current transaction, loader, and Sweettest consumers handle
    Rejected distinctly.
  • Dance, loader, bootstrap, and resource projections are regenerated through map-schema.
  • End-to-end tests prove rejection, zero writes, retained findings, successful correction, and
    accepted canonical bootstrap.
  • Formatting, checks, unit tests, and Sweettests pass.

Optional Details (Expand if needed)

8. Alternatives Considered

  • Validate inside the existing persistence loop: rejected because earlier holons could already
    be written before a later violation is found.
  • Return Incomplete for validation findings: rejected because semantic refusal and operational
    failure have different retry and diagnostic meanings.
  • Serialize CommitValidationReport: rejected because per-holon findings already cross the
    boundary through the staged pool and the string form would be opaque to MAP’s type system.
  • Wait for Capability 2: rejected because VAL-C1a provides everything required to complete the
    Capability 1 vertical slice.

9. Risks or Concerns

  • Validation outcome writeback must complete before persistence begins and must preserve existing operational errors and relationship lock discipline.
  • Rejection changes loader accounting assumptions: rejected holons are neither saved nor abandoned.
  • Generated schema changes affect loader metrics and copied bootstrap/resource projections.

10. Additional Context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions