Skip to content

feat: respect repository contribution rules#85

Open
shaoohh wants to merge 3 commits into
mainfrom
codex/issue-77-repo-rules
Open

feat: respect repository contribution rules#85
shaoohh wants to merge 3 commits into
mainfrom
codex/issue-77-repo-rules

Conversation

@shaoohh

@shaoohh shaoohh commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

What this changes

This PR teaches OpenMeta to read repository contribution rules before it tries to open an automatic PR, and to back off into review/artifact mode when those rules are not safely satisfied.

It adds lightweight repository rule discovery and caching, uses structured LLM extraction for freeform contribution docs, and threads the detected rules through PR drafting, branch/commit naming, and final PR submission gating.

Why

Issue #77 is really about one thing: OpenMeta should stop treating every repository as if contribution workflows are the same.

A lot of repositories require issue links, prior discussion, validation notes, PR templates, release note context, or specific naming conventions. Before this change, those rules were mostly invisible to the agent, which meant it could generate artifacts that looked plausible but still violated the repository's actual contribution process.

Highlights

  • discover contribution-related files such as CONTRIBUTING.md, PR templates, CODEOWNERS, and issue templates
  • cache extracted repository rules locally to avoid repeating the same scan
  • use structured LLM extraction to turn freeform docs into a normalized repository rules object
  • include repository rules in patch drafting and PR drafting context
  • reuse detected PR template bodies when building PR content
  • apply deterministic rule-gate checks before opening a real PR
  • show explicit CLI blocking reasons when automatic PR creation is skipped
  • record review reasons in artifacts and memory outputs

Testing

  • bun test test/content.test.ts test/contribution-pr.test.ts test/llm.test.ts test/agent-run.test.ts
  • bun test test/agent-orchestrator.test.ts test/state-services.test.ts test/workspace.test.ts

@shaoohh shaoohh force-pushed the codex/issue-77-repo-rules branch from c678ece to cb6a207 Compare June 29, 2026 09:40
@NianJiuZst

Copy link
Copy Markdown
Owner

need rebase

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