Skip to content

Downstream consumer boundary tracking (12.1.1) - #151

Merged
leynos merged 22 commits into
mainfrom
12-1-1-track-downstream-consumer-boundary
Jun 22, 2026
Merged

Downstream consumer boundary tracking (12.1.1)#151
leynos merged 22 commits into
mainfrom
12-1-1-track-downstream-consumer-boundary

Conversation

@lodyai

@lodyai lodyai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements roadmap task 12.1.1, "Track the downstream consumer boundary,"
in full. All stages A–E of the ExecPlan are complete.

Deliverables:

  • Four-state classification vocabulary (consumes, wraps, pending,
    divergent) defined in a new "Boundary classification" section of
    docs/adr-007-agent-native-command-surface.md, with per-state evidence
    requirements and staleness rules.
  • TOML manifest (docs/orthoconfig-consumer-boundary.toml) as the
    single machine-readable source of truth, covering roadmap tasks 12.1.1
    through 20.3.3 with an explicit managed_tasks registry (fail-closed,
    no topic-keyword heuristics).
  • Generated Markdown matrix (docs/orthoconfig-consumer-boundary.md)
    committed byte-for-byte, regenerated via the render_boundary_matrix
    example in weaver-docs-gate.
  • crates/weaver-docs-gate — new workspace member hosting:
    • Domain types (BoundaryState, UpstreamRole, UpstreamRef,
      BoundaryTask, BoundaryManifest) and error types (BoundaryError,
      BoundaryFileError) with remediation text.
    • load_manifest / load_manifest_file public API with tracing
      events and a bounded weaver_docs_gate_boundary_manifest_load_total
      counter (labels: source, outcome).
    • TOML deserialisation adapter (manifest_adapter) with DTO-to-domain
      From conversions and an empty_string_as_none serde helper.
    • Markdown renderer (render_matrix) with deterministic phase grouping
      and column-width calculation.
    • Integration tests in tests/boundary_manifest.rs: referential-
      integrity checks across the manifest, roadmap, and ADR 007 anchors,
      including byte-for-byte matrix equality, ISO date validation, and a
      270-day pending.next_review_by staleness gate.
    • Property-based tests (proptest) for column-width, cell-escaping,
      date-window, phase-grouping, and state-evidence invariants.
    • Compile-time API surface test via trybuild.
  • CI step ("Boundary manifest gate") added to .github/workflows/ci.yml.
  • Documentation updated: docs/roadmap.md (12.1.1 checked, back-links
    for phases 12–20), docs/developers-guide.md (boundary workflow, API
    reference, observability), docs/users-guide.md (provisional divergence
    note), docs/contents.md (matrix entry).
  • ExecPlan (docs/execplans/12-1-1-track-downstream-consumer-boundary.md)
    marked COMPLETE with all decision and surprise logs updated.

Design decisions incorporated from Logisphere pre-implementation review:

  • Gate crate relocated from weaver-build-util to its own
    crates/weaver-docs-gate workspace member.
  • shipped: bool replaced with shipped_in: Option<String> to capture
    specific release tags or commit SHAs.
  • Explicit managed_tasks registry replaces topic-keyword heuristics;
    any task absent from the registry causes the gate to fail.
  • BDD and insta snapshot layers removed in favour of byte-for-byte
    equality checks and proptest.
  • pending.next_review_by fails the gate when more than 270 days in the
    past relative to the manifest build date (computed reproducibly for
    deterministic builds).

Test plan

  • cargo test -p weaver-docs-gate -- boundary_manifest --nocapture
    verifies referential integrity across the manifest, roadmap, and
    ADR 007 anchors.
  • cargo test -p weaver-docs-gate covers DTO mapping, file-loading
    error paths, renderer output, property-based invariants, and the
    render_boundary_matrix CLI example.
  • cargo test -p weaver-docs-gate -- compile_time confirms the
    public API surface compiles as a downstream caller.
  • make check-fmt && make lint && make test && make markdownlint && make nixie all pass.

References

  • ExecPlan
  • Lody session
  • Related issues: #154 (property-based testing), #153 (string-argument
    refactor)

Draft ExecPlan for roadmap task 12.1.1, "Track the downstream consumer
boundary". The plan delivers a TOML manifest, a generated Markdown
matrix, an ADR 007 vocabulary section, and a referential-integrity
gate in a new weaver-docs-gate workspace member so every command-
contract task records whether it consumes OrthoConfig, wraps it
temporarily, depends on a not-yet-decided upstream contract, or
deliberately diverges via ADR 007. Revised after a Logisphere
pre-implementation review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @LodyAI[bot], you have reached your weekly rate limit of 2500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Introduces the weaver-docs-gate Rust crate providing load_manifest and render_matrix functions backed by a four-state TOML manifest schema, a CLI example, and integration tests enforcing referential integrity and byte-for-byte Markdown freshness. Commits docs/orthoconfig-consumer-boundary.toml and .md, cross-linking ADR 007, roadmap phases 12–20, developers' guide, users' guide, and ExecPlan 12.1.1.

Changes

OrthoConfig Consumer Boundary Matrix Gate

Layer / File(s) Summary
Workspace manifest and crate registration
Cargo.toml, crates/weaver-docs-gate/Cargo.toml
Registers weaver-docs-gate as a workspace member, pins ortho_config to a git revision, expands time features to include macros and parsing, adds toml = "0.9.12" and trybuild = "1.0", and declares all workspace-driven dependencies in the new crate manifest.
Boundary manifest data model and public error types
crates/weaver-docs-gate/src/lib.rs
Defines BoundaryState, UpstreamRole, UpstreamRef, BoundaryTask, BoundaryManifest with stable as_str() helpers; introduces reader-based load_manifest and file-based load_manifest_file; splits error handling into BoundaryError (parser domain) and BoundaryFileError (filesystem context) with explicit path-bearing variants; includes metrics and tracing instrumentation.
TOML adapter DTOs and type conversions
crates/weaver-docs-gate/src/manifest_adapter.rs
Defines Serde DTOs (BoundaryManifestDto, BoundaryTaskDto, UpstreamRefDto, BoundaryStateDto, UpstreamRoleDto) with snake_case renaming for TOML vocabulary alignment; implements empty_string_as_none for optional fields; provides exhaustive From conversions from each DTO to the corresponding domain type.
Markdown matrix renderer
crates/weaver-docs-gate/src/renderer/mod.rs
Implements render_matrix grouping tasks by phase, computing dynamic column widths from escaped cell text, escaping pipe and newline characters, converting BoundaryTask into MatrixRow with state symbols and upstream links, rendering phase tables with fixed preamble and markdownlint disable/enable wrapper.
Renderer tests: snapshot and property-based validation
crates/weaver-docs-gate/src/renderer/tests.rs
Unit tests validate phase grouping without prefix collisions, column width computation from escaped cell contents, and render output shape via insta snapshot; proptest suite covers width accommodation, escaping safety (no raw newlines or unescaped pipes), phase grouping correctness, and column injection prevention.
render_boundary_matrix CLI example
crates/weaver-docs-gate/examples/render_boundary_matrix.rs
Adds a two-argument CLI binary that parses manifest and output paths, calls load_manifest_file and render_matrix, then writes the result using write_output with cap_std ambient directory authority for sandboxed file access.
Integration tests: manifest loading, conversion, and subprocess validation
crates/weaver-docs-gate/tests/load_manifest.rs
Tests all BoundaryError paths (unreadable stream, invalid schema), file-based error variants (not found, invalid path, directory as file), positive DTO-to-domain mapping, and subprocess execution of the render_boundary_matrix example with success and failure modes; provides temp-directory, sandboxed file I/O, repo-root, and assertion helpers.
Pending-review date staleness validator
crates/weaver-docs-gate/tests/support/pending_review_date.rs
Implements validate_pending_review_date using a 270-day window, parsing ISO-8601 date-only strings and comparing whole-day differences against a provided build date; includes unit tests for exact boundary and first-expired-day rejection plus property-based tests for acceptance and rejection coverage.
Property-based tests for state evidence constraints
crates/weaver-docs-gate/tests/support/boundary_properties.rs
Uses proptest to validate ISO date string format acceptance (exact YYYY-MM-DD shape) and rejection of invalid lengths and separators; validates that validate_state_evidence accepts precisely the evidence-field combinations required for each BoundaryState; generates arbitrary evidence flags and states to verify acceptance/rejection boundaries.
Compile-time public API verification
crates/weaver-docs-gate/tests/compile_time.rs, crates/weaver-docs-gate/tests/ui/public_api.rs
Adds trybuild integration test and UI fixture that exercises the public API surface (render_matrix, load_manifest, load_manifest_file) and verifies error types satisfy Error + Debug + Send + Sync + 'static trait bounds; constructs BoundaryManifest values using public domain types to ensure downstream compatibility.
Integration tests: referential integrity and matrix freshness
crates/weaver-docs-gate/tests/boundary_manifest.rs
Asserts managed_tasks matches task rows without duplicates, every task ID appears in roadmap.md, per-state evidence constraints hold (ISO date shape, non-empty upstream, state-specific field presence/absence, pending staleness), Divergent tasks reference known ADR 007 anchors, and committed Markdown equals render_matrix output; includes roadmap parsing, anchor generation, and deterministic failure reporting.
Committed TOML manifest
docs/orthoconfig-consumer-boundary.toml
Introduces the authoritative versioned task manifest: schema_version = 1, managed_tasks task-ID list, detailed task records from 12.1.1 to 20.3.3 with upstream OrthoConfig dependencies and lifecycle metadata (shipped_in, removal_gate, adr_anchor, next_review_by, last_reviewed).
Generated Markdown matrix
docs/orthoconfig-consumer-boundary.md
Introduces the generated consumer-boundary roadmap matrix with regeneration header (command and provenance) followed by Phase 12–20 tables enumerating tasks with state, upstream references, shipped status, removal/divergence gates, and review timestamps.
ADR 007 boundary section and documentation index
docs/adr-007-agent-native-command-surface.md, docs/contents.md
Adds Boundary classification section to ADR 007 specifying the four-state vocabulary, authoritative TOML source, matrix column semantics, and per-state evidence requirements; updates docs index to link the generated consumer-boundary matrix.
Developers' and users' guides
docs/developers-guide.md, docs/users-guide.md
Expands developers' guide with required pre-step workflow to update the consumer-boundary matrix before changing command classification, documents CI failure message shape and recovery steps, and describes weaver-docs-gate API (domain types, error variants, load/render workflow, metrics and tracing); adds users' guide note explaining pending/wrapper tasks may produce Weaver-owned behaviour differences until OrthoConfig contract convergence.
ExecPlan 12.1.1 and roadmap cross-links
docs/execplans/12-1-1-track-downstream-consumer-boundary.md, docs/roadmap.md
Commits complete ExecPlan for roadmap item 12.1.1 specifying the boundary vocabulary, manifest design, validation approach, and five-stage execution plan with acceptance criteria; updates roadmap phases 12.1.1–20.3 with explicit consumer-boundary matrix links for task classification tracking.
CI boundary manifest gate step
.github/workflows/ci.yml
Adds GitHub Actions CI step running cargo test -p weaver-docs-gate --test boundary_manifest -- --nocapture to validate boundary manifest integrity, referential consistency, and matrix freshness on each push.

Sequence Diagram

sequenceDiagram
  rect rgba(100, 149, 237, 0.5)
    note over CLI,render_matrix: render_boundary_matrix CLI example flow
    participant CLI as render_boundary_matrix
    participant load_manifest_file
    participant cap_std_Dir as cap_std::Dir
    participant load_manifest
    participant toml_parse as TOML parser
    participant render_matrix
    CLI->>load_manifest_file: path: &Utf8Path
    load_manifest_file->>cap_std_Dir: open_ambient_dir(parent)
    cap_std_Dir-->>load_manifest_file: Dir
    load_manifest_file->>cap_std_Dir: read_to_string(file_name)
    cap_std_Dir-->>load_manifest_file: file contents
    load_manifest_file->>load_manifest: impl Read
    load_manifest->>toml_parse: parse manifest from bytes
    toml_parse-->>load_manifest: BoundaryManifest
    load_manifest-->>load_manifest_file: Ok(BoundaryManifest)
    load_manifest_file-->>CLI: Ok(BoundaryManifest)
    CLI->>render_matrix: &BoundaryManifest
    render_matrix-->>CLI: Markdown String
    CLI->>cap_std_Dir: write rendered output
  end
Loading

Possibly Related Issues

  • Add property-based tests for renderer and date-validation invariants in weaver-docs-gate #154: The changes implement all four property-based test invariants requested in that issue. The crates/weaver-docs-gate/src/renderer/tests.rs adds proptest suites covering column-width calculation, Markdown table-cell escaping, and phase grouping correctness. The crates/weaver-docs-gate/tests/support/pending_review_date.rs and crates/weaver-docs-gate/tests/support/boundary_properties.rs add property-based tests for the 270-day pending-review-date-window validation invariant and ISO date format validation, covering both acceptance within bounds and rejection outside bounds.

Poem

A boundary drawn in TOML neat,
Four states to classify each feat—
Consumes, wraps, pending, divergent true,
The matrix rendered, tested through.
Gate holds the contract, checks stand tall,
No stale review date shall enthrall! 🦀

🚥 Pre-merge checks | ✅ 19 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Developer Documentation ⚠️ Warning ExecPlan status documentation contradicts PR description: document states "Status: COMPLETE" with all stages A-E executed, but PR claims "DRAFT pending approval" and "no implementation work." Roadm... Reconcile PR description with ExecPlan document status. Update PR description to reflect actual COMPLETE status with implementation present, or update ExecPlan and roadmap to restore DRAFT status if this is indeed a planning document only.
✅ Passed checks (19 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Testing (Overall) ✅ Passed All new functionality is guarded by substantive, rigorous tests. Critical byte-for-byte equality check verifies rendering. Property-based tests validate phase grouping, column widths, cell escaping...
User-Facing Documentation ✅ Passed User-facing documentation is adequately addressed. The PR adds a note to docs/users-guide.md explaining that the OrthoConfig consumer boundary matrix tracks which command-contract tasks consume O...
Module-Level Documentation ✅ Passed All 11 modules in the new crates/weaver-docs-gate carry comprehensive module-level documentation explaining purpose, utility, and component relationships.
Testing (Unit And Behavioural) ✅ Passed PR includes comprehensive unit tests (edge cases, error paths, invariants), property-based tests for algorithmic concerns, integration tests exercising the full manifest-rendering workflow across a...
Testing (Property / Proof) ✅ Passed All identified algorithmic invariants—column-width calculation, Markdown table-cell escaping, date-window validation (270-day pending window), phase grouping, state-evidence constraints, and ISO da...
Testing (Compile-Time / Ui) ✅ Passed PR includes trybuild compile-time test (public_api_contracts_compile), UI compile-time test (public_api.rs exercising Error + Debug + Send + Sync + 'static), and 7 inline snapshot tests (6 error me...
Unit Architecture ✅ Passed Queries and commands are clearly separated: render_matrix is a pure function; load_manifest and load_manifest_file explicitly return Result types for fallibility. Domain types, TOML adapter, and Ma...
Domain Architecture ✅ Passed Domain logic is well-segregated from infrastructure. Domain types (BoundaryState, UpstreamRole, UpstreamRef, BoundaryTask, BoundaryManifest) have zero imports of serialization, filesystem, or obser...
Observability ✅ Passed Manifest loading has bounded metrics labels (source: reader|file, outcome: success|unreadable|invalid_schema|not_found|invalid_path), structured tracing logs with remediation guidance, and no sensi...
Security And Privacy ✅ Passed No secrets, credentials, unsafe deserialization, path traversal, injection vectors, or sensitive data exposure detected. File I/O uses cap_std safely, metrics employ bounded labels, errors are stab...
Performance And Resource Use ✅ Passed Algorithms and I/O patterns are efficient relative to input bounds (49 tasks, ~1100 line documents). No quadratic loops detected; all text processing is linear. BTreeSet enables O(log n) lookups. S...
Concurrency And State ✅ Passed No concurrency issues detected. The crate is purely synchronous, single-threaded, with no shared mutable state, locks, channels, or async code. Metrics use a library-safe facade pattern.
Architectural Complexity And Maintainability ✅ Passed New weaver-docs-gate crate maintains proportional architectural complexity: focused responsibility, justified abstractions (DTOs, domain enums, dual error types), appropriate third-party dependen...
Rust Compiler Lint Integrity ✅ Passed The PR contains no lint suppressions, unnecessary clones, artificial lint appeasement code, or stale helpers. All ownership is intentional, functions are actively used, and module boundaries are cl...
Title check ✅ Passed The title directly references roadmap task 12.1.1 and accurately describes the PR's primary objective to establish downstream consumer boundary tracking.
Description check ✅ Passed The PR description comprehensively addresses the changeset, detailing deliverables, design decisions, test coverage, and implementation status for task 12.1.1.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 12-1-1-track-downstream-consumer-boundary

Comment @coderabbitai help to get the list of available commands and usage tips.

leynos added 5 commits June 14, 2026 05:03
Add the ADR 007 boundary classification section with the fixed state vocabulary and matrix column contract for downstream command-contract tasks.

Mark the 12.1.1 ExecPlan as active and record Stage A validation, CodeRabbit review, and the temporary OrthoConfig SHA pin decision.
Add a private docs-gate crate that parses the consumer-boundary
manifest and renders the committed Markdown matrix from it.

Pin `ortho_config` to the requested upstream SHA until the project
settles an OrthoConfig v0.9.0 release, and record the Stage B gate and
CodeRabbit evidence in the ExecPlan.
Cross-link the generated consumer boundary matrix from the documentation
index, developer workflow, and each manifest-managed roadmap task group.

Record the Stage C validation and CodeRabbit result in the ExecPlan so the
next implementation slice can continue from the reviewed state.
Add integration tests that validate the boundary manifest against the
roadmap, ADR 007 anchors, state-specific evidence fields, and the committed
Markdown matrix.

Keep the renderer aligned with the formatter-stable matrix output and record
Stage D validation plus CodeRabbit follow-up in the ExecPlan.
Document the temporary wrapper and pending-contract states users may
encounter before the 0.1.0 command-surface compatibility promise.

Record the final Stage E gates and clean CodeRabbit review in the ExecPlan.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos

leynos commented Jun 14, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

crates/weaver-docs-gate/tests/boundary_manifest.rs

Comment on file

//! Integration tests for the `OrthoConfig` consumer boundary manifest.

❌ New issue: String Heavy Function Arguments
In this module, 50.0% of all arguments to its 20 functions are strings. The threshold for string arguments is 39.0%

@leynos

leynos commented Jun 14, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

crates/weaver-docs-gate/tests/boundary_manifest.rs

Comment on lines +211 to +228

fn validate_consumes_evidence(task: &BoundaryTask) -> TestResult {
    ensure(
        task.shipped_in.is_some(),
        format!("consumes task {} must name shipped_in", task.id),
    )?;
    ensure(
        task.removal_gate.is_none(),
        format!("consumes task {} must not carry removal_gate", task.id),
    )?;
    ensure(
        task.adr_anchor.is_none(),
        format!("consumes task {} must not carry adr_anchor", task.id),
    )?;
    ensure(
        task.next_review_by.is_none(),
        format!("consumes task {} must not carry next_review_by", task.id),
    )
}

❌ New issue: Code Duplication
The module contains 3 functions with similar structure: validate_consumes_evidence,validate_divergence_evidence,validate_wraps_evidence

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

Replace path-string helper parameters with Utf8Path inputs and field-name
labels with a small enum so the docs-gate tests model those arguments with
more precise types.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Share the repeated optional-field validation used by the boundary manifest
state evidence tests, and let the basic assertion helper accept string-like
messages directly.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos

leynos commented Jun 14, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

crates/weaver-docs-gate/tests/boundary_manifest.rs

Comment on lines +254 to +265

fn validate_consumes_evidence(task: &BoundaryTask) -> TestResult {
    validate_field_constraints(
        task,
        "consumes",
        ("shipped_in", task.shipped_in.is_some()),
        &[
            ("removal_gate", task.removal_gate.is_some()),
            ("adr_anchor", task.adr_anchor.is_some()),
            ("next_review_by", task.next_review_by.is_some()),
        ],
    )
}

❌ New issue: Code Duplication
The module contains 3 functions with similar structure: validate_consumes_evidence,validate_divergence_evidence,validate_wraps_evidence

@coderabbitai

This comment was marked as resolved.

Replace the duplicated state-specific wrapper functions in the docs-gate
boundary manifest tests with a single dispatcher that preserves the existing
field constraint rules for each state.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos
leynos marked this pull request as ready for review June 15, 2026 22:45

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c73e831826

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Cargo.toml
Comment thread crates/weaver-docs-gate/tests/boundary_manifest.rs
Mark roadmap task 12.1.1 complete and update the ExecPlan with the final
implementation status, follow-up test refactors, validation evidence, and
retrospective findings.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Parse pending next_review_by dates in the docs-gate boundary manifest
test and fail rows whose review date is more than 270 days behind the
build date, using SOURCE_DATE_EPOCH when present for reproducible builds.

Record the post-completion gate fix in the ExecPlan.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@coderabbitai

This comment was marked as resolved.

@leynos

leynos commented Jun 21, 2026

Copy link
Copy Markdown
Owner

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

Replace the separate parser and file-adapter error assertion helpers with
one generic helper that preserves debug diagnostics on mismatch. Keep the
load-manifest test cases and fixture data unchanged.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Add component-level docs for the renderer tests and matrix regeneration
example. Make the boundary manifest gate emit structured failure messages,
trace validation decisions, and increment a validation-failure metric while
keeping the observability crates as docs-gate dev-dependencies.

Run the boundary manifest gate as a named CI step and document the
remediation path in the developer guide, roadmap, and ExecPlan.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos

leynos commented Jun 21, 2026

Copy link
Copy Markdown
Owner

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

Emit `tracing` events and load-outcome metrics from the docs-gate
manifest reader and file adapter so callers can diagnose read, path, and
schema failures outside the integration tests.

Include remediation guidance in generated parser/file errors, remove the
renderer test helper clone path flagged by review, and update the roadmap,
developer guide, and ExecPlan with the operational boundary.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos

leynos commented Jun 21, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

Code Duplication

crates/weaver-docs-gate/src/lib.rs:

What lead to degradation?

The module contains 2 functions with similar structure: record_file_load_success,record_load_success

Why does this problem occur?

Duplicated code often leads to code that's harder to change since the same logical change has to be done in multiple functions. More duplication gives lower code health.

How to fix it?

A certain degree of duplicated code might be acceptable. The problems start when it is the same behavior that is duplicated across the functions in the module, ie. a violation of the Don't Repeat Yourself (DRY) principle. DRY violations lead to code that is changed together in predictable patterns, which is both expensive and risky. DRY violations can be identified using CodeScene's X-Ray analysis to detect clusters of change coupled functions with high code similarity. Read More
Once you have identified the similarities across functions, look to extract and encapsulate the concept that varies into its own function(s). These shared abstractions can then be re-used, which minimizes the amount of duplication and simplifies change.

@leynos

leynos commented Jun 21, 2026

Copy link
Copy Markdown
Owner

@coderabbitai resume

@coderabbitai

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

Document the `load_manifest` and `load_manifest_file` tracing and metrics
side effects in public Rustdoc so downstream callers see the operational
contract at the API boundary.

Add example CLI error-path coverage, property checks for ISO date and
state/evidence invariants, and a `trybuild` pass test that compiles a
small downstream public API fixture.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos

leynos commented Jun 21, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

crates/weaver-docs-gate/tests/support/boundary_properties.rs

Comment on lines +140 to +167

const fn expected_state_evidence(state: BoundaryState, flags: EvidenceFlags) -> bool {
    match state {
        BoundaryState::Consumes => {
            flags.has(SHIPPED_IN)
                && !flags.has(REMOVAL_GATE)
                && !flags.has(ADR_ANCHOR)
                && !flags.has(NEXT_REVIEW_BY)
        }
        BoundaryState::Wraps => {
            flags.has(REMOVAL_GATE)
                && !flags.has(SHIPPED_IN)
                && !flags.has(ADR_ANCHOR)
                && !flags.has(NEXT_REVIEW_BY)
        }
        BoundaryState::Pending => {
            flags.has(NEXT_REVIEW_BY)
                && !flags.has(SHIPPED_IN)
                && !flags.has(REMOVAL_GATE)
                && !flags.has(ADR_ANCHOR)
        }
        BoundaryState::Divergent => {
            flags.has(ADR_ANCHOR)
                && !flags.has(SHIPPED_IN)
                && !flags.has(REMOVAL_GATE)
                && !flags.has(NEXT_REVIEW_BY)
        }
    }
}

❌ New issue: Complex Method
expected_state_evidence has a cyclomatic complexity of 14, threshold = 9

@coderabbitai

This comment was marked as resolved.

Replace the separate reader and file success helpers with one
`record_success` helper that keeps the source label and optional path field
explicit while sharing the success metric and trace event shape.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Replace the state-specific compound boolean checks with a direct
required-bit comparison so the property oracle matches the four-bit
evidence model without exceeding the complexity threshold.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Remove the mechanical manifest DTO adapter and deserialize the boundary
manifest directly into the public domain types. Keep the TOML spelling
contract explicit with serde renames and empty-string handling for optional
evidence fields.

Expand the property tests around the manifest gate so generated inputs cover
registry symmetry, arbitrary state/evidence rows, ADR anchor membership, and
Markdown heading-anchor shape.
@leynos

leynos commented Jun 22, 2026

Copy link
Copy Markdown
Owner

@coderabbitai please provide an updated PR description:

Check name Status Explanation Resolution
Developer Documentation ⚠️ Warning ExecPlan status documentation contradicts PR description: document states "Status: COMPLETE" with all stages A-E executed, but PR claims "DRAFT pending approval" and "no implementation work." Roadm... Reconcile PR description with ExecPlan document status. Update PR description to reflect actual COMPLETE status with implementation present, or update ExecPlan and roadmap to restore DRAFT status if this is indeed a planning document only.

@coderabbitai

This comment was marked as resolved.

@leynos leynos changed the title Plan downstream consumer boundary tracking (12.1.1) Downstream consumer boundary tracking (12.1.1) Jun 22, 2026
@leynos
leynos merged commit cfce970 into main Jun 22, 2026
12 checks passed
@leynos
leynos deleted the 12-1-1-track-downstream-consumer-boundary branch June 22, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants