Skip to content

Contract hardening from the import-review findings (compete 1.14.0) - #3

Merged
ainetx merged 3 commits into
constructorfabric:mainfrom
vasylcf:feat/contract-hardening-1.14.0
Aug 6, 2026
Merged

Contract hardening from the import-review findings (compete 1.14.0)#3
ainetx merged 3 commits into
constructorfabric:mainfrom
vasylcf:feat/contract-hardening-1.14.0

Conversation

@vasylcf

@vasylcf vasylcf commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What

The deferred contract-level findings from #1's review, tracked in #2 — one compete minor release (1.14.0, whatsnew entry included). Closes #2.

Contracts (rules/templates/workflows)

  • Idempotent traceability back-links in all 10 rules files and all 10 authoring workflows: append only when the ID is absent (replacing the default no-derived-artifacts line when present); an existing line is updated in place — a refresh never duplicates it.
  • Watch-pass binding: a prior WATCH-REPORT seeds change detection only when it belongs to the same commissioning request and confirmed watched-field set; each pass's slug carries a per-pass token (date or label, e.g. openspec-baseline) so every pass mints a distinct ID.
  • Artifact-ID lifecycle: profile and OSS-review refreshes update the registered file in place (same ID, same registry entry) — never a second file; templates carry the policy next to the ID line; the dossier's Section 9 records the explicit no-profile state, and the direct-dossier path creates + registers the fact ledger before citing time-sensitive facts.
  • One vendor-posture enum (open-source | open-core | partly-open-source | closed-source | not_assessed) — the workflow description no longer abbreviates.
  • Section 8 (Traceability) is an explicit authoring step in the taxonomy and mechanism contracts.
  • CPT-TAX-NO-001 exemption defined: the only allowed subset-union is a corpus the user explicitly accepted as unmined at the design gate, recorded as the Section 2 completeness note; the design-gate proposal names those vendors first.
  • Mechanism map integrity: a mechanism without a documented analogue is recorded as a limitation/follow-up (or a Section 5 hypothesis seed), never a map row.
  • Capture URL policy: destinations validated before any fetch — http(s) only, public (global) addresses only, redirect targets revalidated, rejections logged as capture failures.

Scripts

  • check_artifact_refs.py / render_views.py: kind detection prefers the KIND-named ancestor directory over ID-token scanning, so a hyphenated {system} slug containing a reserved token (cpt-cmp-platform-reg-demo) resolves correctly; ID-scan remains the fallback for loose files, and the unknown-kind negative still fails.

Examples

  • Profile example splits corporate: captured from finance: deferred (honest per-class statuses).
  • OSS repository rows state why each is not a drop-in alternative (REPO-OSS-005).
  • Mechanism example moves machine-local isolation out of the map into an adjacent-surface note, per its own Section 4 rule.

CI

  • Ambiguous-slug kind-detection case added to the kind-detection step.
  • New temp-project e2e: cfs init → kit install --kit compete → validate-kits → generate-agents, asserting the generated cf-compete-run skill exists.

Verification (local)

  • cfs validate-kits . all passed; cfs kit normalize --dry-run . --json --kit all PASS; cfs pdsl validate 25/25 PASS
  • Full deterministic suite green: check_evidence, intake dry-run, refs on 11 examples (incl. taxonomy binding), deck renders script-free, mine_terms 10/10+12/12, coverage 9/9 flows, pricing, guardrail greps
  • Kind detection: ambiguous slug under CANDIDATE-REGISTER/ resolves as reg; unknown-kind negative still fails
  • E2E install into a clean project → 2 kits validated, 15 cf-compete-* skills generated

🤖 Generated with Claude Code

https://claude.ai/code/session_016phJWcmabz45DpvUUiC1C3

Summary by CodeRabbit

  • New Features

    • Updated the Competitive Analysis Kit to version 1.14.0.
    • Improved artifact identification for hyphenated and ambiguous names.
    • Watch reports now receive distinct pass identifiers.
  • Improvements

    • Refreshes update existing artifacts and traceability links without duplicates.
    • Capture workflows block private, local, and unsafe redirect destinations.
    • Strengthened taxonomy, mechanism, vendor, evidence, and dossier requirements.
  • Tests

    • Added end-to-end installation, validation, and generation coverage.

…(compete 1.14.0)

- Idempotent traceability back-links in every authoring contract:
  append only when the ID is absent, update the existing line otherwise
- Watch passes bind to their commissioning request and watched-field
  set; per-pass slug token keeps every pass ID unique
- Explicit artifact-ID lifecycle: profile/OSS refreshes update the
  registered file in place; dossier records the no-profile state and
  the direct path creates its fact ledger before time-sensitive facts
- One vendor-posture enum across the OSS-REVIEW surface; taxonomy and
  mechanism contracts author Section 8 explicitly; CPT-TAX-NO-001 names
  its sole exemption (user-accepted unmined corpus in Evidence Scope)
- Undocumented mechanisms stay out of the Mechanism Map (limitation or
  hypothesis seed until evidence supports a row)
- capture validates destinations before any fetch: http(s) only, public
  addresses only, redirects revalidated, rejections logged
- Kind detection prefers the KIND-named ancestor directory over
  ID-token scanning (cpt-cmp-platform-reg-demo resolves as reg); CI
  covers the ambiguous-slug case
- Examples: corporate/finance split; OSS drop-in boundaries; mechanism
  example moves local isolation to an adjacent-surface note
- CI: temp-project install + generate-agents e2e job

Closes constructorfabric#2

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016phJWcmabz45DpvUUiC1C3
Signed-off-by: vasylcf <vasylcf@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@vasylcf, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 19e6eefa-31b4-4b52-8371-502ec707a537

📥 Commits

Reviewing files that changed from the base of the PR and between 04d3914 and a444c1f.

📒 Files selected for processing (20)
  • kits/compete/artifacts/CANDIDATE-REGISTER/rules.md
  • kits/compete/artifacts/COMPANY-DOSSIER/rules.md
  • kits/compete/artifacts/COMPANY-PROFILE/rules.md
  • kits/compete/artifacts/COMPARISON-MATRIX/rules.md
  • kits/compete/artifacts/FEATURE-TAXONOMY/rules.md
  • kits/compete/artifacts/MECHANISM-STUDY/rules.md
  • kits/compete/artifacts/ORIENTATION-CARD/rules.md
  • kits/compete/artifacts/OSS-REVIEW/rules.md
  • kits/compete/artifacts/RESEARCH-REVIEW/rules.md
  • kits/compete/artifacts/WATCH-REPORT/rules.md
  • kits/compete/workflows/compare.md
  • kits/compete/workflows/discover.md
  • kits/compete/workflows/dossier.md
  • kits/compete/workflows/mechanism.md
  • kits/compete/workflows/orient.md
  • kits/compete/workflows/oss-review.md
  • kits/compete/workflows/profile.md
  • kits/compete/workflows/review.md
  • kits/compete/workflows/taxonomy.md
  • kits/compete/workflows/watch.md
📝 Walkthrough

Walkthrough

The compete kit advances to version 1.14.0. It adds idempotent traceability and refresh rules, tighter workflow contracts, public-destination validation, directory-based artifact-kind detection, and CI coverage for rendering and temporary-project generation.

Changes

Compete kit contract hardening

Layer / File(s) Summary
Artifact lifecycle and traceability
kits/compete/artifacts/*, kits/compete/workflows/*
Artifact refreshes reuse existing IDs where required. Traceability links replace placeholders, append only when absent, and update existing entries in place.
Workflow domain contracts
kits/compete/workflows/capture.md, kits/compete/workflows/watch.md, kits/compete/workflows/taxonomy.md, kits/compete/workflows/mechanism.md, kits/compete/workflows/oss-review.md, kits/compete/artifacts/*/examples/*
Capture destinations and redirects require public HTTP(S) addresses. Watch reports bind to the request and watched fields. Taxonomy, mechanism, dossier, and OSS review rules define revised authoring and validation states.
Directory-based kind detection
kits/compete/scripts/check_artifact_refs.py, kits/compete/scripts/render_views.py, .github/workflows/ci.yml
Artifact kind resolution checks recognized ancestor directory names before falling back to ID-token detection. CI covers reserved tokens in system slugs.
Release metadata and end-to-end validation
.cf-studio-kit.toml, kits/compete/conf.toml, kits/compete/README.md, kits/compete/whatsnew.toml, .github/workflows/ci.yml
Kit metadata and release notes record version 1.14.0. CI tests temporary-project installation, kit validation, agent generation, and the generated cf-compete-run skill.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the contract-hardening changes and the compete 1.14.0 release.
Linked Issues check ✅ Passed The changes address the linked issue objectives, including idempotency, validation, lifecycle rules, taxonomy, mechanism, examples, and CI coverage.
Out of Scope Changes check ✅ Passed The version updates, release notes, examples, CI coverage, and implementation changes support the stated contract-hardening objectives.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@vasylcf

vasylcf commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 5

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

166-175: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test check_artifact_refs.py with the ambiguous fixture.

Lines 168-175 only execute render_views.py. The separate check_artifact_refs.py implementation is not covered by the reserved-slug fixture. Add a direct assertion that its path-based lookup returns "reg".

Proposed CI addition
           python3 scripts/render_views.py /tmp/kind-test/CANDIDATE-REGISTER/ambiguous.md \
             --format csv --out-dir /tmp/kind-test
           head -1 /tmp/kind-test/ambiguous.csv \
             | grep -qx "candidate,relationship,why_in_scope,evidence,next_action"
+          python3 - <<'PY'
+          from pathlib import Path
+          from scripts.check_artifact_refs import kind_from_path
+          assert kind_from_path(
+              Path("/tmp/kind-test/CANDIDATE-REGISTER/ambiguous.md")
+          ) == "reg"
+          PY
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 166 - 175, Add a CI assertion in the
ambiguous fixture block after preparing the fixture to invoke
check_artifact_refs.py with that fixture and verify its path-based lookup
returns "reg". Keep the existing render_views.py CSV assertion unchanged and
target the check_artifact_refs.py lookup behavior directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@kits/compete/artifacts/CANDIDATE-REGISTER/rules.md`:
- Line 29: Update the refresh flows so existing IDs are resolved before
uniqueness validation: in kits/compete/artifacts/CANDIDATE-REGISTER/rules.md:29,
resolve an existing register ID and update its registered file in place,
validating uniqueness only for new IDs; apply the same dossier-ID behavior in
kits/compete/artifacts/COMPANY-DOSSIER/rules.md:36 and taxonomy-ID behavior in
kits/compete/workflows/taxonomy.md:121-126. Preserve in-place
commissioning-request link updates without appending duplicates.

In `@kits/compete/artifacts/FEATURE-TAXONOMY/rules.md`:
- Line 54: Update the CPT-TAX-NO-001 exemption and validation workflow so the
Section 2 unmined-vendor completeness note explicitly identifies each unmined
vendor and separately records verifiable design-gate approval. Validate both the
vendor-specific identification and approval before allowing the exemption;
otherwise retain CPT-TAX-NO-001 as a hard fail.

In `@kits/compete/artifacts/OSS-REVIEW/rules.md`:
- Around line 33-34: Update the backlink refresh rules so every refresh
normalizes the current artifact ID to exactly one commissioning-request link,
updates that link’s title in place, and preserves unrelated links. Apply this to
OSS-REVIEW in kits/compete/artifacts/OSS-REVIEW/rules.md:33-34, RESEARCH-REVIEW
in kits/compete/artifacts/RESEARCH-REVIEW/rules.md:51-51, WATCH-REPORT in
kits/compete/artifacts/WATCH-REPORT/rules.md:36-38, COMPARISON-MATRIX in
kits/compete/workflows/compare.md:115-118, CANDIDATE-REGISTER in
kits/compete/workflows/discover.md:117-120, COMPANY-DOSSIER in
kits/compete/workflows/dossier.md:102-105, MECHANISM-STUDY in
kits/compete/workflows/mechanism.md:109-112, and ORIENTATION-CARD in
kits/compete/workflows/orient.md:98-101; each site requires the same
duplicate-removal and in-place title-update behavior.

In `@kits/compete/artifacts/WATCH-REPORT/rules.md`:
- Around line 36-38: Update the Traceability refresh rule in the report workflow
to remove any pre-existing duplicate links for the current pass ID, then retain
exactly one link for that ID with the latest report title. Preserve the existing
behavior of replacing the default no-derived-artifacts line and avoiding
duplicate appends.

In `@kits/compete/workflows/watch.md`:
- Around line 75-81: Update the WATCH-REPORT rules in rules.md to resolve prior
reports only when they match both the commissioning request ID and the
normalized watched-field set. Ensure change-report mode is used only for an
exact match; otherwise use baseline mode, preserving the request and field-set
binding defined by the watch workflow.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 166-175: Add a CI assertion in the ambiguous fixture block after
preparing the fixture to invoke check_artifact_refs.py with that fixture and
verify its path-based lookup returns "reg". Keep the existing render_views.py
CSV assertion unchanged and target the check_artifact_refs.py lookup behavior
directly.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 22ef59f4-953b-425e-b4bc-f3a3a2e96f76

📥 Commits

Reviewing files that changed from the base of the PR and between 7ccac84 and fedef09.

📒 Files selected for processing (34)
  • .cf-studio-kit.toml
  • .github/workflows/ci.yml
  • kits/compete/README.md
  • kits/compete/artifacts/CANDIDATE-REGISTER/rules.md
  • kits/compete/artifacts/COMPANY-DOSSIER/rules.md
  • kits/compete/artifacts/COMPANY-DOSSIER/template.md
  • kits/compete/artifacts/COMPANY-PROFILE/examples/example.md
  • kits/compete/artifacts/COMPANY-PROFILE/rules.md
  • kits/compete/artifacts/COMPANY-PROFILE/template.md
  • kits/compete/artifacts/COMPARISON-MATRIX/rules.md
  • kits/compete/artifacts/FEATURE-TAXONOMY/rules.md
  • kits/compete/artifacts/MECHANISM-STUDY/examples/example.md
  • kits/compete/artifacts/MECHANISM-STUDY/rules.md
  • kits/compete/artifacts/ORIENTATION-CARD/rules.md
  • kits/compete/artifacts/OSS-REVIEW/examples/example.md
  • kits/compete/artifacts/OSS-REVIEW/rules.md
  • kits/compete/artifacts/RESEARCH-REVIEW/rules.md
  • kits/compete/artifacts/WATCH-REPORT/rules.md
  • kits/compete/artifacts/WATCH-REPORT/template.md
  • kits/compete/conf.toml
  • kits/compete/scripts/check_artifact_refs.py
  • kits/compete/scripts/render_views.py
  • kits/compete/whatsnew.toml
  • kits/compete/workflows/capture.md
  • kits/compete/workflows/compare.md
  • kits/compete/workflows/discover.md
  • kits/compete/workflows/dossier.md
  • kits/compete/workflows/mechanism.md
  • kits/compete/workflows/orient.md
  • kits/compete/workflows/oss-review.md
  • kits/compete/workflows/profile.md
  • kits/compete/workflows/review.md
  • kits/compete/workflows/taxonomy.md
  • kits/compete/workflows/watch.md

Comment thread kits/compete/artifacts/CANDIDATE-REGISTER/rules.md Outdated
Comment thread kits/compete/artifacts/FEATURE-TAXONOMY/rules.md Outdated
Comment thread kits/compete/artifacts/OSS-REVIEW/rules.md Outdated
Comment thread kits/compete/artifacts/WATCH-REPORT/rules.md Outdated
Comment thread kits/compete/workflows/watch.md
…ble exemption, duplicate repair, watch rules aligned

- In-place refresh on an existing ID now stated for every stable-ID
  kind (register, dossier, orientation card, matrix, mechanism study,
  taxonomy) in both rules and workflows; per-pass kinds (watch) state
  the opposite: a colliding ID means the per-pass token is missing
- CPT-TAX-NO-001 exemption is auditable: the Section 2 note must name
  each unmined vendor and cite the design-gate approval (turn/option);
  a generic note grants nothing — enforced by a new UNION-EXEMPT
  checklist item
- Backlink refresh also repairs duplicates left by earlier runs:
  collapse all lines for the ID into one, leave other artifacts' lines
  untouched (all rules + workflows)
- WATCH-REPORT rules now match the workflow: the prior report must
  share the commissioning request ID and confirmed watched-field set;
  baseline otherwise

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016phJWcmabz45DpvUUiC1C3
Signed-off-by: vasylcf <vasylcf@gmail.com>

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@kits/compete/artifacts/COMPANY-DOSSIER/rules.md`:
- Around line 35-36: Update the refresh backlink rules in
kits/compete/artifacts/COMPANY-DOSSIER/rules.md lines 35-36 so any existing
valid dossier backlink also removes the contradictory no-derived-artifacts
sentinel while preserving duplicate collapse behavior. Apply the same change to
the matrix backlink refresh logic in kits/compete/workflows/compare.md lines
116-120; other artifact links must remain untouched.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ba8621c-2c37-4c63-ad82-9f8d945f8acd

📥 Commits

Reviewing files that changed from the base of the PR and between fedef09 and 04d3914.

📒 Files selected for processing (21)
  • kits/compete/artifacts/CANDIDATE-REGISTER/rules.md
  • kits/compete/artifacts/COMPANY-DOSSIER/rules.md
  • kits/compete/artifacts/COMPANY-PROFILE/rules.md
  • kits/compete/artifacts/COMPARISON-MATRIX/rules.md
  • kits/compete/artifacts/FEATURE-TAXONOMY/checklist.md
  • kits/compete/artifacts/FEATURE-TAXONOMY/rules.md
  • kits/compete/artifacts/MECHANISM-STUDY/rules.md
  • kits/compete/artifacts/ORIENTATION-CARD/rules.md
  • kits/compete/artifacts/OSS-REVIEW/rules.md
  • kits/compete/artifacts/RESEARCH-REVIEW/rules.md
  • kits/compete/artifacts/WATCH-REPORT/rules.md
  • kits/compete/workflows/compare.md
  • kits/compete/workflows/discover.md
  • kits/compete/workflows/dossier.md
  • kits/compete/workflows/mechanism.md
  • kits/compete/workflows/orient.md
  • kits/compete/workflows/oss-review.md
  • kits/compete/workflows/profile.md
  • kits/compete/workflows/review.md
  • kits/compete/workflows/taxonomy.md
  • kits/compete/workflows/watch.md
🚧 Files skipped from review as they are similar to previous changes (18)
  • kits/compete/artifacts/ORIENTATION-CARD/rules.md
  • kits/compete/workflows/review.md
  • kits/compete/workflows/taxonomy.md
  • kits/compete/workflows/discover.md
  • kits/compete/workflows/dossier.md
  • kits/compete/artifacts/RESEARCH-REVIEW/rules.md
  • kits/compete/artifacts/COMPANY-PROFILE/rules.md
  • kits/compete/workflows/oss-review.md
  • kits/compete/artifacts/OSS-REVIEW/rules.md
  • kits/compete/artifacts/CANDIDATE-REGISTER/rules.md
  • kits/compete/workflows/mechanism.md
  • kits/compete/workflows/profile.md
  • kits/compete/artifacts/COMPARISON-MATRIX/rules.md
  • kits/compete/artifacts/MECHANISM-STUDY/rules.md
  • kits/compete/artifacts/FEATURE-TAXONOMY/rules.md
  • kits/compete/artifacts/WATCH-REPORT/rules.md
  • kits/compete/workflows/watch.md
  • kits/compete/workflows/orient.md

Comment thread kits/compete/artifacts/COMPANY-DOSSIER/rules.md Outdated
… exists

A prior run could leave both a valid back-link and the contradictory
sentinel; the refresh contract now removes the sentinel in every branch,
uniformly across all rules and workflows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016phJWcmabz45DpvUUiC1C3
Signed-off-by: vasylcf <vasylcf@gmail.com>
@ainetx
ainetx merged commit 3ec6f1a into constructorfabric:main Aug 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compete kit: contract-hardening follow-up from the import PR review

2 participants