Skip to content

docs(specs): cgis init-ontology design — auto-proposed patterns.yaml (#174)#198

Merged
zaebee merged 2 commits into
mainfrom
docs/spec-174-init-ontology
Jun 12, 2026
Merged

docs(specs): cgis init-ontology design — auto-proposed patterns.yaml (#174)#198
zaebee merged 2 commits into
mainfrom
docs/spec-174-init-ontology

Conversation

@zaebee

@zaebee zaebee commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

Design spec for #174 (roadmap #179 P0, the adoption-blocker half of the pair with merged #178): cgis init-ontology proposes a ready-to-edit patterns.yaml from the measured graph — measure-then-label instead of a blank page.

Key decisions:

  • DriftScorer IS the fitter (approach A): per-domain fit = score() against each of the 5 bundled templates via a synthetic DomainConfig — zero new fitting math; layer weights / empty-layer exclusion / unresolved discount inherited from _score_v2, so proposed numbers stay comparable to later drift runs
  • Honest no-fit branch (user-decided): best fit > 0.5 → hygiene-only + # no template fits (best: X at 0.55) — no forced labels (the httpx mislabel trap from 🗺️ Roadmap: priorities from multi-repo dogfooding (#170–#178) #179); below min_nodes / zero edges → hygiene-only with reasons. Hygiene-only entries also get measured+margin tolerance so the round-trip guarantee covers cycle-bearing unlabeled domains
  • Round-trip acceptance: propose → analyze_drift on the same graph → no empty, nothing above its proposed tolerance, gate green by construction; on fixtures and the cgis self-graph
  • Surfaces (user-decided): CLI init-ontology (overwrite-refusal without --force) + MCP cgis_init_ontology returning YAML text read-only — no file writes from MCP (avoids the S2083 taint class)
  • Bundled default header (profiles/patterns/hygiene, no cgis domains) as a module constant, pinned against docs/ontology/patterns.yaml by a staleness test
  • Lane A discipline: new query/ontology_init.py module, append-only CLI/MCP blocks (parallel-session contract)

Test Plan

🤖 Generated with Claude Code

…174)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zaebee

zaebee commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@zaebee

zaebee commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

/guardian review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM — no defects found in this diff.

Diff is a design document (spec) with no executable code changes. No logic, type, contract, ontology, or test coverage defects to report.


🤖 mistral-medium-latest · 5,734 prompt + 41 completion = 5,775 tokens

github-actions Bot added a commit that referenced this pull request Jun 12, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a design specification for cgis init-ontology to auto-propose a patterns.yaml file. The feedback suggests explicitly validating that the SQLite database file exists before opening a connection in both the propose_ontology flow and the MCP tool to prevent SQLite from silently creating empty database files.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docs/specs/2026-06-12-init-ontology-design.md Outdated
Comment thread docs/specs/2026-06-12-init-ontology-design.md Outdated
…e (gemini review)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a design specification for the cgis init-ontology feature, which automatically proposes a patterns.yaml configuration to simplify onboarding. The feedback suggests updating the proposed flow to explicitly validate the existence of the SQLite database file before opening the store, preventing SQLite from silently creating an empty database file.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docs/specs/2026-06-12-init-ontology-design.md
@sonarqubecloud

Copy link
Copy Markdown

@zaebee zaebee merged commit 30322fc into main Jun 12, 2026
3 checks passed
@zaebee zaebee deleted the docs/spec-174-init-ontology branch June 12, 2026 20:16
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.

Add cgis init-ontology: auto-propose patterns.yaml from measured graph

1 participant