Skip to content

[codex] add artifact contract CI pipeline - #4

Merged
2233admin merged 3 commits into
mainfrom
codex-ci-artifact-contract
Jun 23, 2026
Merged

[codex] add artifact contract CI pipeline#4
2233admin merged 3 commits into
mainfrom
codex-ci-artifact-contract

Conversation

@2233admin

Copy link
Copy Markdown
Owner

Summary

  • add artifact data contract, domain glossary, and ADR for Rust artifact-reader boundary
  • add Rust code-intel CLI contract tests and offline GitHub research tests
  • update GitHub Actions to build, test, package, and run a secret-pattern guard

Validation

  • cargo fmt -p code-intel -- --check
  • cargo check
  • cargo test -p code-intel
  • PowerShell parser checks
  • test-github-solution-research.ps1
  • test-code-intel-pipeline.ps1 -SkipRepowise -SkipSentruxGate -SkipGitHubResearch -AllowGraphMissing
  • local package zip smoke

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@2233admin, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 26 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

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 credits.

🚦 How do rate limits work?

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

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8123babf-b501-4b60-80c8-01e181f260db

📥 Commits

Reviewing files that changed from the base of the PR and between 2c9bffd and 68cc1cc.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (40)
  • .deepsource.toml
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .github/workflows/skill-check.yml
  • .gitignore
  • CONTEXT.md
  • Cargo.toml
  • Find-CodeIntelProjects.ps1
  • Invoke-GitHubSolutionResearch.ps1
  • README.md
  • crates/code-intel-cli/Cargo.toml
  • crates/code-intel-cli/src/main.rs
  • crates/code-nexus-lite/Cargo.toml
  • docs/adr/0001-rust-cli-reads-artifacts.md
  • docs/adr/0002-agent-goal-intake-outside-scanner.md
  • docs/adr/0003-harness-factory-as-distribution-reference.md
  • docs/adr/0004-yao-meta-skill-as-skill-development-benchmark.md
  • docs/adr/0005-ponytail-as-implementation-minimalism-benchmark.md
  • docs/adr/0006-project-management-support-as-agent-intake.md
  • docs/agent-goal-intake.md
  • docs/agents/domain.md
  • docs/agents/issue-tracker.md
  • docs/agents/triage-labels.md
  • docs/artifact-data-contract.md
  • docs/code-intel-architecture.md
  • docs/harness-factory-reference.md
  • docs/implementation-minimalism-benchmark.md
  • docs/ponytail-gain-ledger.md
  • docs/ponytail-impact-scoreboard.md
  • docs/project-management-support.md
  • docs/skill-development-benchmark.md
  • invoke-code-intel.ps1
  • pipeline.config.json
  • run-code-intel.ps1
  • skill/SKILL.md
  • test-code-intel-pipeline.ps1
  • test-github-solution-research.ps1
  • test-project-discovery.ps1
  • test-project-management-support.ps1
  • test-skill-development-benchmark.ps1
📝 Walkthrough

Walkthrough

Adds a Rust code-intel CLI crate for reading pipeline artifacts (resume, classify, doctor), introduces Invoke-GitHubSolutionResearch.ps1 wired into the hospital-report state machine, adds Find-CodeIntelProjects.ps1 for scoring candidate repos, updates CI/release workflows for Rust builds and Windows ZIP packaging, and introduces a large documentation corpus with six ADRs and multiple contract verification scripts.

Changes

Rust CLI Crate

Layer / File(s) Summary
Cargo workspace and crate manifests
Cargo.toml, crates/code-intel-cli/Cargo.toml, crates/code-nexus-lite/Cargo.toml
Creates the workspace manifest with release profile settings, adds the code-intel crate manifest with serde_json, and removes the now-redundant [profile.release] block from code-nexus-lite.
CLI entrypoint, command handlers, and utilities
crates/code-intel-cli/src/main.rs
Implements main, parse_args, cmd_resume, cmd_classify, cmd_doctor, build_resume_summary, next_read routing, text/JSON output helpers, filesystem/JSON navigation utilities, help text, and unit tests covering resume routing and classify research-required logic.
Rust CLI ADR and README docs
docs/adr/0001-rust-cli-reads-artifacts.md, README.md, CONTEXT.md
Adds ADR 0001 defining the CLI as an artifact reader, inserts a Rust CLI resume preview section in README, and adds the pipeline vocabulary context document.

GitHub Solution Research Feature

Layer / File(s) Summary
Invoke-GitHubSolutionResearch script
Invoke-GitHubSolutionResearch.ps1
Defines script params, helper functions, query-building from FailedSteps, main flow handling skip/missing-gh/auto-generated paths, artifact writing (github-solution-research.json and .md), and the return summary object.
run-code-intel.ps1 hospital report integration
run-code-intel.ps1
Adds research-decision helpers, updates Get-HospitalNextProtocol and New-HospitalDecisionBlock to route on GitHubResearch, expands New-CodeIntelHospitalReport and Markdown output, adds the orchestration block that invokes the research script, and surfaces research fields in $report, summary.md, and understanding.md.
invoke-code-intel.ps1 SkipGitHubResearch wiring
invoke-code-intel.ps1
Adds -SkipGitHubResearch switch to the public interface, extends the extended-options branch condition, and forwards the flag into run-code-intel.ps1.
Contract tests for GitHub solution research
test-code-intel-pipeline.ps1, test-github-solution-research.ps1
Extends pipeline contract test with SkipGitHubResearch, deferred failure, githubResearch section requirements, and conditional routing assertions; adds a standalone test covering skip/missing-gh/fake-gh scenarios with schema validation.

Project Discovery Utility

Layer / File(s) Summary
Find-CodeIntelProjects script
Find-CodeIntelProjects.ps1
Defines params, signal-weight table, helper functions (Add-Candidate, Read-WizTreeCandidates, Read-DirectoryCandidates, Invoke-WizTreeExport), main dispatch, result filtering/projection, and JSON/table output.
test-project-discovery.ps1 contract test
test-project-discovery.ps1
Sets up fixture directories, runs filesystem and WizTree CSV discovery modes, and asserts expected repos are found while non-qualifying directories are absent.

CI/CD, Documentation Corpus, and Config

Layer / File(s) Summary
CI and release workflow updates
.github/workflows/ci.yml, .github/workflows/release.yml, .github/workflows/skill-check.yml, .gitignore
Inserts Rust build/test/format/check steps, PowerShell parser/secret-guard steps, expands pipeline steps with Doctor and contract tests, adds -SkipGitHubResearch, replaces packaging with Windows ZIP creation and artifact upload, fixes skill-check output-file robustness.
DeepSource and pipeline config
.deepsource.toml, pipeline.config.json
Adds DeepSource config with Rust/Python analyzer settings; updates pipeline config with additional inventoryExclude patterns and multiple opencli-admin repo entries.
Artifact data contract and architecture docs
docs/artifact-data-contract.md, docs/code-intel-architecture.md, docs/harness-factory-reference.md
Defines run layout, routing fields, and next_protocol values; adds cross-reference from architecture doc; adds harness factory reference.
Agent intake, project management, and domain docs
docs/agent-goal-intake.md, docs/agents/..., docs/project-management-support.md, docs/adr/0002-*.mddocs/adr/0006-*.md
Adds goal intake, domain, issue-tracker, triage-labels, and project-management-support docs; adds five ADRs (0002–0006) establishing runtime boundaries for intake, harness, skill benchmarks, and project management.
Benchmark docs and ledger
docs/skill-development-benchmark.md, docs/implementation-minimalism-benchmark.md, docs/ponytail-gain-ledger.md, docs/ponytail-impact-scoreboard.md
Adds skill development benchmark, implementation minimalism decision ladder, open-gains ledger (PG-001–009), and impact scoreboard with measurement contract.
README, SKILL.md, and doc cross-linking
README.md, skill/SKILL.md
Expands README quick-start with discovery step and Rust CLI preview; expands skill/SKILL.md canonical file list, adds discovery guidance and minimalism rules.
Doc compliance contract tests
test-project-management-support.ps1, test-skill-development-benchmark.ps1
Adds scripts that assert required patterns across docs, ADRs, README, CONTEXT.md, and SKILL.md using file-content assertions.

Sequence Diagram(s)

sequenceDiagram
  participant Agent
  participant invoke_code_intel as invoke-code-intel.ps1
  participant run_code_intel as run-code-intel.ps1
  participant Invoke_GHResearch as Invoke-GitHubSolutionResearch.ps1
  participant gh as gh CLI
  participant HospitalReport as New-CodeIntelHospitalReport

  Agent->>invoke_code_intel: -RepoPath ./repo -SkipGitHubResearch
  invoke_code_intel->>run_code_intel: -SkipGitHubResearch
  run_code_intel->>run_code_intel: classify failures → githubResearch decision
  alt research required and not skipped
    run_code_intel->>Invoke_GHResearch: -FailedSteps -FailureClassifications
    Invoke_GHResearch->>gh: gh search issues/prs/repos/code
    gh-->>Invoke_GHResearch: JSON candidates
    Invoke_GHResearch-->>run_code_intel: {status, path, markdown, required}
  else skipped or gh missing
    run_code_intel->>run_code_intel: set manual_required githubResearch
  end
  run_code_intel->>HospitalReport: GitHubResearch object
  HospitalReport->>HospitalReport: Get-HospitalNextProtocol → github_solution_research
  HospitalReport-->>run_code_intel: hospital-report.json + .md
  run_code_intel-->>Agent: report.json, summary.md, understanding.md
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Poem

🐇 Hippity-hoppity, artifacts glow,
A Rust CLI reads where next we should go.
GitHub research hunts for blockers afar,
WizTree finds repos near and near,
Docs, ADRs, and ledgers in a row—
The pipeline bunny says: now we know! 🐰


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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a new Rust CLI tool code-intel to resume, classify, and diagnose artifact runs, along with a defined artifact data contract and a PowerShell helper Invoke-GitHubSolutionResearch.ps1 to research pipeline blockers on GitHub. Feedback on these changes highlights a critical bug in run-code-intel.ps1 where an undefined $root variable will cause a strict-mode crash, as well as opportunities to improve the Rust CLI's robustness by gracefully handling missing directories, unreadable entries, and invalid JSON files. Additionally, unit tests in the CLI should be updated to clean up their temporary directories on disk.

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 run-code-intel.ps1

$githubResearch = New-GitHubSolutionResearchNotApplicable
if (Test-GitHubSolutionResearchRequired $failureCounts) {
$githubResearchScript = Join-Path $root "Invoke-GitHubSolutionResearch.ps1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The variable $root is not defined anywhere in run-code-intel.ps1. Since Set-StrictMode -Version Latest is enabled, referencing this undefined variable will throw a runtime exception and crash the script when GitHub solution research is triggered. It should be replaced with $PSScriptRoot to correctly reference the script's directory.

    $githubResearchScript = Join-Path $PSScriptRoot "Invoke-GitHubSolutionResearch.ps1"

Comment on lines +396 to +403
fn latest_run_dir(repo_artifacts: &Path) -> Result<PathBuf> {
let mut dirs = Vec::new();
for entry in fs::read_dir(repo_artifacts)? {
let entry = entry?;
if entry.file_type()?.is_dir() {
dirs.push(entry.path());
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If the repo_artifacts directory does not exist, fs::read_dir will return an error and crash the CLI. Additionally, if any single entry within the directory is unreadable (e.g., due to permission issues), entry? or entry.file_type()? will fail and abort the entire scan. It is more robust to handle the missing directory with a helpful error message and skip unreadable entries gracefully.

fn latest_run_dir(repo_artifacts: &Path) -> Result<PathBuf> {
    let mut dirs = Vec::new();
    let entries = fs::read_dir(repo_artifacts).map_err(|e| {
        format!(
            "failed to read artifact directory '{}': {e}. Has the scanner run at least once?",
            repo_artifacts.display()
        )
    })?;
    for entry in entries {
        if let Ok(entry) = entry {
            if let Ok(ft) = entry.file_type() {
                if ft.is_dir() {
                    dirs.push(entry.path());
                }
            }
        }
    }

Comment on lines +414 to +417
fn read_json(path: &Path) -> Result<Value> {
let text = fs::read_to_string(path)?;
Ok(serde_json::from_str(text.trim_start_matches('\u{feff}'))?)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If the JSON file is empty or contains invalid JSON, serde_json::from_str will fail. Attaching context to the error helps the user identify which file failed to parse.

fn read_json(path: &Path) -> Result<Value> {
    let text = fs::read_to_string(path).map_err(|e| {
        format!("failed to read file '{}': {e}", path.display())
    })?;
    serde_json::from_str(text.trim_start_matches('\u{feff}')).map_err(|e| {
        format!("failed to parse JSON in '{}': {e}", path.display()).into()
    })
}

Comment on lines +571 to +573
assert!(!summary.research_required);
assert_eq!(next_read(&summary), dir.join("understanding.md"));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The test creates a temporary directory on disk but does not clean it up, leading to accumulation of leftover directories in the system's temp folder. Consider cleaning up the directory at the end of the test.

Suggested change
assert!(!summary.research_required);
assert_eq!(next_read(&summary), dir.join("understanding.md"));
}
assert!(!summary.research_required);
assert_eq!(next_read(&summary), dir.join("understanding.md"));
let _ = fs::remove_dir_all(&dir);
}

Comment on lines +623 to +625
assert_eq!(summary.hospital_next_protocol, "github_solution_research");
assert_eq!(next_read(&summary), research_markdown);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The test creates a temporary directory on disk but does not clean it up, leading to accumulation of leftover directories in the system's temp folder. Consider cleaning up the directory at the end of the test.

Suggested change
assert_eq!(summary.hospital_next_protocol, "github_solution_research");
assert_eq!(next_read(&summary), research_markdown);
}
assert_eq!(summary.hospital_next_protocol, "github_solution_research");
assert_eq!(next_read(&summary), research_markdown);
let _ = fs::remove_dir_all(&dir);
}

@2233admin
2233admin force-pushed the codex-ci-artifact-contract branch 4 times, most recently from c1669ba to 66821a6 Compare June 23, 2026 15:20
@2233admin
2233admin force-pushed the codex-ci-artifact-contract branch from 66821a6 to 0bf0d3b Compare June 23, 2026 15:37
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.

1 participant