Skip to content

feat: migrate to Core's git-free incremental (#401)#52

Open
Svilen-Stefanov wants to merge 4 commits into
mainfrom
feat/git-free-incremental
Open

feat: migrate to Core's git-free incremental (#401)#52
Svilen-Stefanov wants to merge 4 commits into
mainfrom
feat/git-free-incremental

Conversation

@Svilen-Stefanov

@Svilen-Stefanov Svilen-Stefanov commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Why

CodeBoarding Core's content-versioning stack (CodeBoarding#401) removed the git-ref incremental API. Once it merges to Core main, this action breaks: engine_adapter.py calls run_full/run_incremental with the old signatures (repo_path=/output_dir=/base_ref=/target_ref=/source_sha=), which now raise TypeError. metadata.commit_hash — which sync mode used to identify its baseline — is also gone.

New Core API:

  • run_full(run_paths: RunPaths, run_context: RunContext, depth_level=, source_sha=)
  • run_incremental(run_paths: RunPaths, run_context: RunContext)no base/target ref; it diffs a whole-tree fingerprint.json sidecar against the checkout itself.

Changes

engine_adapter.py

  • Migrate every run_full/run_incremental call to (RunPaths, RunContext) via a _run_ctx() helper. Drop base_ref/target_ref from run_incremental and from the head subcommand + argparser.
  • run_seed now also writes fingerprint.json (hash_repo_source_files) — the baseline git-free incremental diffs against.
  • run_analyze (sync): drop the commit_hash trustworthiness gate. A present analysis.json runs incremental (Core self-falls-back to full on a missing sidecar/cache); full only on --force-full or no baseline.

action.yml

Sync mode is naturally git-free ("analyze the latest state, commit the architecture back") — so it no longer needs a baseline SHA or a worktree:

  • Seed the sync workdir from the committed .codeboarding/ directly (analysis.json + fingerprint.json), gated on both files' presence. Removed the baseline-SHA git worktree add seed and the commit_hash lookup.
  • Commit fingerprint.json back alongside analysis.json + the pkl, so the next sync's baseline is self-contained. Dropped the now-redundant SHA-keyed sync static-analysis cache (the pkl travels via git, a more durable cross-runner baseline).

Review mode stays git-based — a PR review inherently compares two commits — but its base seed now also emits fingerprint.json, and the base cache key is bumped v2 → v3 (the cached base dir now includes the sidecar).

Tests

Updated the engine_adapter/sync stubs for the new Core symbols (RunPaths/RunContext/write_fingerprint/hash_repo_source_files) and rewrote the head/analyze tests for the (RunPaths, RunContext) call shape and the git-free baseline gate. 171 passing.

Depends on

  • CodeBoarding#401 (the content-versioning stack that changes the Core API).
  • Companion Core-side fix: CodeBoarding#406 (github_action.py, Core's own docs.yml entry point — a different file from this action repo).

🤖 Generated with Claude Code

Outdated analysis.json migration

The action now defaults to CodeBoarding Core 0.13.0. Before attempting an incremental run, it loads the baseline through the installed Core's UnifiedAnalysisJson model and requires a lossless model round-trip. This detects old or otherwise incompatible formats without hardcoding individual JSON properties.

Sync mode

  1. The committed baseline is checked for compatibility.
  2. If it is incompatible, incremental analysis is skipped and a full analysis runs at the baseline's recorded depth (subject to the configured tier limit).
  3. The new 0.13-compatible analysis.json, fingerprint, and caches are committed back to the branch.
  4. The analysis_mode output reports full; later sync runs return to incremental.

Review mode

  1. The target-branch baseline is checked before analyzing the PR.
  2. If it is incompatible, the action runs a full analysis of the target commit to create a fresh comparison baseline.
  3. The PR head is then analyzed against that fresh baseline and the architecture diff/comment is produced normally.

Review mode does not commit the migrated baseline. The sync job persists it. Therefore no manual migration is required: the first affected run performs the necessary full rebuild, and subsequent runs can be incremental again.

Core's content-versioning stack removed the git-ref incremental API: run_full/
run_incremental now take (RunPaths, RunContext), run_incremental drops
base_ref/target_ref/source_sha (it diffs a fingerprint.json sidecar against the
checkout itself), and metadata.commit_hash is gone. Without this the action
TypeErrors on every analysis once #401 lands.

engine_adapter.py:
- Migrate every run_full/run_incremental call to (RunPaths, RunContext) via a
  _run_ctx() helper; drop base_ref/target_ref from run_incremental and the head
  subcommand/argparser.
- run_seed also writes fingerprint.json (hash_repo_source_files), the baseline
  git-free incremental diffs against.
- run_analyze (sync): drop the commit_hash trustworthiness gate — a present
  analysis.json runs incremental (Core self-falls-back to full on a missing
  sidecar/cache); full only on force_full or no baseline.

action.yml (sync mode is naturally git-free — analyze latest, commit back):
- Seed the sync workdir from the committed .codeboarding/ directly
  (analysis.json + fingerprint.json), gated on both files' presence; drop the
  baseline-SHA worktree seed and the commit_hash lookup.
- Commit fingerprint.json back alongside analysis.json + the pkl so the next
  sync's baseline is self-contained; drop the now-redundant SHA-keyed sync
  static-analysis cache (the pkl travels via git).
- Review mode stays git-based (a PR review compares two commits): its base seed
  now also emits fingerprint.json; bump the base cache key v2 -> v3.

Tests: update engine_adapter/sync stubs for the new Core symbols; rewrite the
head/analyze tests for the (RunPaths, RunContext) call shape and the git-free
baseline gate. 171 passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@codeboarding-review

codeboarding-review Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Architecture review · failed

The architecture diff couldn't be generated for this run. See the workflow logs for details.

codeboarding-action · run 29246147062

Svilen-Stefanov and others added 2 commits July 13, 2026 13:22
The best-effort engine import degrades every engine symbol to None, so an
installed codeboarding package that predates Core #401 (no RunPaths/RunContext)
made the analysis subcommands die with a cryptic "'NoneType' object is not
callable" deep in _run_ctx. Guard base/seed/head/analyze/render at dispatch
with a clear message naming the missing git-free API and the codeboarding_version
pin to fix. Metadata-only subcommands, concat, and best-effort health are
unaffected. Makes true the module's own claim that these subcommands "fail
loudly when these are None".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TEMPORARY, revert before merge. This PR targets Core's git-free API (#401),
which is on Core main but not yet on PyPI, so the pinned codeboarding_version
default (0.12.5) can't exercise it. Install the engine from Core main in the
dogfood review job so this PR validates the migration end to end. Drop this
before merge so the action ships a released version, never a git ref.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@Svilen-Stefanov Svilen-Stefanov left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM.

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