Skip to content

docs(proposals): P-026 project resource model files - #186

Closed
PhysShell wants to merge 2 commits into
mainfrom
claude/own-net-positioning-7mmqbf
Closed

PhysShell wants to merge 2 commits into
mainfrom
claude/own-net-positioning-7mmqbf

Conversation

@PhysShell

Copy link
Copy Markdown
Owner

Что и зачем

Добавляет docs/proposals/P-026-resource-model-files.md — proposal на декларативные, per-project файлы моделей ресурсов (own.models.yaml), которые позволяют объявлять свои acquire/release/capture-конвенции (например, ConnectionFactory.Open()/Connection.Close()), резолвя их через тот же project-local SemanticModel, что уже использует P-014, без добавления нового hardcoded classifier в Program.cs. Идея внешне предложена ревьюером как аналог Coverity custom models; я сверил её с существующим кодом/документами репозитория (ownlang/ownir.py:_prelude_resources(), P-014, P-015, P-024) и оформил как отдельный proposal с явным разграничением от P-015 (config surface) и объяснением, почему это не повторяет DSL, отвергнутый в P-024.

Тип изменения

  • feat — новая возможность
  • fix — исправление бага
  • docs — документация
  • refactor / chore / test / ci — без изменения поведения

Как проверено

  • python tests/run_tests.py
  • ruff check . и mypy
  • селфтесты затронутых скриптов (python scripts/<...>.py --selftest)

Изменение чисто документационное (новый docs/proposals/*.md + запись в индексе docs/proposals/README.md), кода не касается — прогонять тесты/линтеры не требовалось.

Связанные issue

Нет — инициировано обсуждением в чате, не привязано к issue.

Чеклист

  • изменение покрыто тестом/селфтестом (или объяснено, почему нет) — не применимо, документация не тестируется run_tests.py
  • README/docs обновлены при необходимости — добавлена запись в docs/proposals/README.md
  • коммиты в conventional-commit стиле (feat:, fix:, docs: …)

Generated by Claude Code

Externalizes the compiled-in resource-kind table
(ownlang/ownir.py _prelude_resources) into a declarative,
symbol-resolved project config so a codebase can teach the
extractor its own acquire/release conventions (e.g.
ConnectionFactory.Open()/Connection.Close()) without a new
hardcoded classifier in Program.cs. Grounded against P-014's
semantic-resolution discipline and P-015/P-024's precedents so
it stays a fact producer, not a second detection DSL.
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4e8ebe76-5130-4d72-81dd-8df2099291f9

📥 Commits

Reviewing files that changed from the base of the PR and between 5ea68da and 9ae499a.

📒 Files selected for processing (2)
  • docs/proposals/P-026-resource-model-files.md
  • docs/proposals/README.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/own-net-positioning-7mmqbf

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.

@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: a6d906c782

ℹ️ 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 on lines +168 to +169
No change to `ownlang/`, `spec/OwnIR.md`, or the JSON schema — a project kind is
indistinguishable, downstream of fact emission, from a built-in one. The only

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include the required OwnIR changes for custom kinds

When a model declares a project-specific kind such as db connection, the current bridge cannot carry that through unchanged: OwnIR's resource discriminator is a closed vocabulary (spec/ownir.schema.json and ownlang/ownir.py::_KNOWN_RESOURCE_KINDS) and load() rejects unknown values, while existing lowering derives the displayed tag from the built-in kind. If implementers follow this proposal and add only an extractor-side loader, custom model entries will either fail to load or be reported under a built-in tag instead of [resource: <declared kind>]. Please either constrain models to existing discriminator/tag pairs or include the needed schema/core/prelude changes here.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Good catch, confirmed against the code — resource/[resource: …] is a closed, fixed-mapping vocabulary (ownlang/ownir.py::_KNOWN_RESOURCE_KINDS/_RESOURCES, pinned by spec/ownir.schema.json), and load() rejects an unknown value. Fixed in 9ae499a: v0 now binds project model entries to an existing discriminator (inheriting its already-fixed tag) instead of claiming a free-text kind/tag, with the precision loss and a scoped-out additive-schema follow-up called out explicitly (Open Question 6).


Generated by Claude Code

…ew ones

Codex review on #186 caught it: the resource discriminator and its
[resource: ...] tag are a closed, fixed-mapping vocabulary
(ownlang/ownir.py::_KNOWN_RESOURCE_KINDS/_RESOURCES, pinned by
spec/ownir.schema.json) that load() rejects unknown values for. v0
now explicitly binds project model entries to an existing
discriminator instead of claiming a free-text kind/tag, with the
precision loss and the scoped-out follow-up (an additive
display_kind field) called out as Open Question 6.

Copy link
Copy Markdown
Owner Author

Консолидировано в #190 (перенумеровано P-026 → P-031-resource-model-files). Закрываю в пользу единого PR.


Generated by Claude Code

@PhysShell PhysShell closed this Jul 8, 2026
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.

2 participants