Commit 290e36b
feat: add sync mode — commit a versioned architecture baseline on push (#28)
* feat: accept docs-only baseline drift when validating the committed baseline
A docs bot committing generated .codeboarding/ and docs/development/ files to
main moves the branch head past the commit the baseline analysis.json was
generated for. validate-base now accepts a baseline whose commit_hash is an
ancestor of the PR base when the intervening diff touches only generated-docs
paths, instead of discarding it and forcing a full base regeneration.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat: docs mode — generate architecture docs and commit them to a branch
One action, two modes. The new 'mode' input (default 'review', unchanged
behavior) adds 'docs': on push/workflow_dispatch/schedule the action analyzes
the pushed commit, renders .codeboarding/*.md (+ optional
docs/development/architecture.md), and commits the results to target_branch
as codeboarding[bot] — absorbing the standalone docs-action so the baseline
writer and its reader (review mode) ship at one version.
- guard: mode dispatch; docs is explicit opt-in, never event-inferred; tag
pushes and pull_request events soft-skip in docs mode; docs inputs
validated; baseline_sha from committed JSON must look like a SHA before it
reaches GITHUB_OUTPUT/cache keys/git
- cb_engine.py: analyze/render/concat subcommands (ported from docs-action's
docs_engine.py); CODEBOARDING_SOURCE telemetry is docs_action for them;
validate-base gains --expected-depth
- depth gates reject only a baseline DEEPER than requested: the engine
records the depth reached, not requested, so a strict != would loop full
analyses forever on repos that never expand
- docs push authenticates the rebase-retry fetch through the same URL as the
push (the shared checkout is credential-free; a bare fetch would hard-fail
private repos instead of failing open)
- engine_ref default v0.12.0 -> v0.12.1 (single pin for both modes)
- new inputs: mode, output_dir, output_format, target_branch,
write_architecture_md, commit_message; new outputs: analysis_mode,
files_written, committed
- docs.yml dogfoods docs mode on this repo; shares a concurrency group with
refresh-baseline.yml (both commit the baseline to main); README documents
the two-thin-workflows consumption pattern and its permission trade-offs
- tests: 86 (26 new) covering the ported subcommands, the depth semantics on
both validate-base acceptance paths, and the analysis_mode= stdout marker
the action greps
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat: default depth_level to 2 for both modes
Bump the shared depth_level default from 1 to 2. Docs are the artifact people
read, so favor analysis quality over cost by default; review mode follows the
same value to keep the committed baseline it reuses at a matching depth.
Consumers who want cheaper, faster runs set depth_level: 1. The deeper-only
baseline gate means existing depth-1 committed baselines still validate under
the depth-2 default (no full-regen loop); the cost is that unset @v1 review
consumers now analyze one level deeper per run.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* refactor: rename docs mode to sync mode
The second mode is a sync engine, not a doc generator: it keeps the committed
architecture analysis (analysis.json + rendered markdown) versioned and current
on the branch, so the architecture has real git history and review mode diffs
against a fresh baseline. 'docs' sold the byproduct (the markdown) and hid the
point (the versioned data), so rename the mode identity to 'sync'.
- public API: mode: docs -> mode: sync; outputs/inputs unchanged in name
- internal: docs_* step ids -> sync_*, cb-docs cache prefix -> cb-sync,
CODEBOARDING_SOURCE telemetry docs_action -> sync, commit_message default
-> 'chore(codeboarding): sync architecture baseline [skip ci]'
- files: docs.yml -> codeboarding-sync.yml (dogfood + README-recommended name),
test_docs_subcommands.py -> test_sync_subcommands.py
- README reframed around versioning/sync; section + anchor renamed
- genuine markdown references kept (docs/development/architecture.md,
write_architecture_md, --docs-dir, 'Render docs')
Unreleased mode, so renaming the mode value breaks no existing consumer.
86 tests pass; actionlint and black clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* chore: add .codeboardingignore to scope analysis
Curated gitignore-style patterns (venv/build output, test/mock/fixture dirs,
generated code, minified bundles) that CodeBoarding analysis loads to exclude
non-production paths — keeps the architecture analysis focused on real code.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* refactor: act on the structure/naming review
Addresses the high-level review's findings — internal legibility, not behavior
(review mode output is unchanged):
- rename scripts/cb_engine.py -> scripts/engine_adapter.py (+ test file): it is
a thin CLI adapter over the separate CodeBoarding engine, not the engine; the
old name implied analysis logic lived here. Docstring now says so up front.
- dedupe the incremental-or-full path: review 'head' and sync 'analyze' shared
~90% logic (try incremental, fall back to full on the same two exceptions);
both now call one _incremental_or_full helper, so a fallback fix lands once.
- move baseline parsing into the adapter: new 'baseline-info' subcommand emits
commit_hash= only when present and SHA-shaped, replacing the sync_seed step's
inline python heredoc + grep with one tested code path.
- add a 'force_full' input (sync mode) that rebuilds the baseline from scratch,
and RETIRE refresh-baseline.yml: it was a 198-line hand-rolled copy of the
action's own pipeline. Its 'fresh full rebuild' is now codeboarding-sync.yml's
workflow_dispatch + force_full, running the tested action instead of a clone.
- structure legibility: a top-of-file phase map (guard / shared setup /
analysis-with-key / drop-key + output) naming the shared analysis.json
baseline as the binding between the two modes; review-only inputs now carry a
'Review mode:' prefix so the Marketplace-rendered view matches the README.
- refresh AGENT.md (was review-only) to describe both modes; document force_full.
93 tests pass (both module orders); actionlint, shellcheck, black clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* chore(codeboarding): update architecture analysis [skip ci]
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: codeboarding[bot] <codeboarding[bot]@users.noreply.github.com>1 parent 57c0aee commit 290e36b
14 files changed
Lines changed: 2168 additions & 626 deletions
File tree
- .codeboarding
- health
- .github/workflows
- docs
- scripts
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
445 | | - | |
| 444 | + | |
| 445 | + | |
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
451 | | - | |
| 450 | + | |
| 451 | + | |
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
456 | | - | |
457 | | - | |
| 456 | + | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
462 | | - | |
463 | | - | |
| 462 | + | |
| 463 | + | |
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
474 | 474 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
0 commit comments