Skip to content

docs: add opt-in understand-quickly publish workflow#7

Open
amacsmith wants to merge 2 commits into
kamilstanuch:mainfrom
amacsmith:feat/uq-publish
Open

docs: add opt-in understand-quickly publish workflow#7
amacsmith wants to merge 2 commits into
kamilstanuch:mainfrom
amacsmith:feat/uq-publish

Conversation

@amacsmith
Copy link
Copy Markdown

Why

looptech-ai/understand-quickly is a public, machine-readable registry of code-knowledge and code-context artifacts. It indexes Codebase Digest output through its bundle@1 format — a tiny JSON pointer plus a raw URL to the digest body — so AI agents (Claude, Codex, Cursor via MCP) can resolve a repo URL to its digest. The registry stores no bodies; the digest stays in the user's repo and is fetched from raw.githubusercontent.com.

This PR is docs-only. It documents the opt-in workflow for cdigest users who want their digest to land in the registry. No CLI changes, no runtime changes.

What changes

  • New file: PUBLISHING.md — explains the registry, one-time setup, and a drop-in .github/workflows/understand-quickly-publish.yml snippet (~30 lines) that runs cdigest, builds a small bundle@1 sidecar (file size, generated_at, content_url, format), and hands it off to the looptech-ai/uq-publish-action@v0.1.0 Marketplace Action.
  • README.md: a one-line pointer at the bottom of the "Usage" examples linking to PUBLISHING.md.

Opt-in / no-op

Submission is gated entirely on the user setting UNDERSTAND_QUICKLY_TOKEN (a fine-grained PAT scoped to looptech-ai/understand-quickly only with Repository dispatches: write). Without the secret, the publish action only stamps metadata locally and exits cleanly. Without the workflow file, nothing changes.

Why no CLI change

The flow is entirely orchestrated in Actions: cdigest already emits the digest, the Marketplace Action builds the bundle@1 sidecar and posts the dispatch. Keeping the integration on the CI side means no new flag in the CLI surface, no test churn, and no behavior change for anyone not opting in.

Test plan

  • Diff is docs-only (one new file at PUBLISHING.md, two-line README pointer).
  • No tests touched, no Python source touched, no setup.py changes.
  • (Reviewer) Markdown renders cleanly on GitHub.

Notes

  • This is opt-in for early adopters; nothing in Codebase Digest's existing surface changes.
  • License & data-grant semantics for users who opt in are described in DATA-LICENSE.md and protocol §12 — opt-in, gated on the secret, never invisible.

Links

Adds PUBLISHING.md describing how users can opt-in to publish their
codebase digest to the understand-quickly registry. The workflow is
gated on UNDERSTAND_QUICKLY_TOKEN — no secret, no network call.

No CLI changes, no behavior changes — docs only.
Copilot AI review requested due to automatic review settings May 10, 2026 07:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Docs-only PR documenting an opt-in GitHub Actions workflow for publishing Codebase Digest output to the external looptech-ai/understand-quickly registry.

Changes:

  • Add PUBLISHING.md describing the registry, one-time setup, and a sample publishing workflow.
  • Add a README.md pointer linking users to PUBLISHING.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
README.md Adds a link guiding users to the publishing documentation.
PUBLISHING.md Introduces end-to-end documentation and a sample GitHub Actions workflow snippet for publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread PUBLISHING.md Outdated
Comment on lines +27 to +40
- run: pip install codebase-digest && cdigest . -o markdown -f digest.md
- name: Build bundle@1 sidecar
run: |
python -c "
import json, os, datetime
b = os.path.getsize('digest.md')
json.dump({
'format': 'bundle@1',
'manifest': {'tool': 'codebase-digest', 'tool_version': 'latest',
'generated_at': datetime.datetime.utcnow().isoformat() + 'Z',
'file_count': 0, 'byte_count': b, 'token_estimate': b // 4,
'format': 'markdown'},
'content_url': 'https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/digest.md'
}, open('digest.bundle.json', 'w'), indent=2)"
Comment thread PUBLISHING.md Outdated
permissions: { contents: read }
steps:
- uses: actions/checkout@v4
- run: pip install codebase-digest && cdigest . -o markdown -f digest.md
Comment thread PUBLISHING.md Outdated
Comment on lines +32 to +37
b = os.path.getsize('digest.md')
json.dump({
'format': 'bundle@1',
'manifest': {'tool': 'codebase-digest', 'tool_version': 'latest',
'generated_at': datetime.datetime.utcnow().isoformat() + 'Z',
'file_count': 0, 'byte_count': b, 'token_estimate': b // 4,
Comment thread PUBLISHING.md Outdated
json.dump({
'format': 'bundle@1',
'manifest': {'tool': 'codebase-digest', 'tool_version': 'latest',
'generated_at': datetime.datetime.utcnow().isoformat() + 'Z',
Comment thread PUBLISHING.md Outdated

## Workflow

Drop into `.github/workflows/understand-quickly-publish.yml`. It runs `cdigest`, writes a small `bundle@1` sidecar, then hands off to the [`looptech-ai/uq-publish-action`](https://github.com/looptech-ai/uq-publish-action) Marketplace Action.
Comment thread PUBLISHING.md Outdated
Comment on lines +14 to +15
Drop into `.github/workflows/understand-quickly-publish.yml`. It runs `cdigest`, writes a small `bundle@1` sidecar, then hands off to the [`looptech-ai/uq-publish-action`](https://github.com/looptech-ai/uq-publish-action) Marketplace Action.

- Add commit step so content_url actually resolves (was pointing to
  raw.githubusercontent.com for an uncommitted digest -> 404).
- Pin content_url to the commit SHA via env var instead of github.ref_name
  (immutable + script-injection safe).
- Use actions/setup-python + python -m pip for reproducibility.
- Use timezone-aware datetime instead of deprecated utcnow().
- Drop hard-coded placeholder fields (tool_version:'latest', file_count:0).
- Note the workflow is only suitable for public repos.
- Grammar fix in intro.
@amacsmith
Copy link
Copy Markdown
Author

Pushed 2a677a1 addressing the Copilot review:

  • content_url 404 (the big one): workflow now commits digest.md to a dedicated understand-quickly orphan branch and pins content_url to that commit SHA, so the raw URL actually resolves.
  • Reproducible Python: switched to actions/setup-python + python -m pip.
  • Timezone-aware timestamp: datetime.now(timezone.utc) instead of deprecated utcnow().
  • Placeholder metadata: dropped tool_version:'latest' and file_count:0 rather than misrepresenting them.
  • Grammar: "Drop into" -> "Add the following as".
  • Public-repo caveat: noted explicitly.
  • Doc/PR-description alignment: the inline-Python sidecar is intentional for this snippet (the Marketplace Action stamps the bundle metadata only when a sidecar isn't pre-built); the doc now reads consistently with that.

@amacsmith
Copy link
Copy Markdown
Author

Quick update from upstream — the registry just hit v0.3.0 with the full toolchain live:

  • looptech-ai/uq-publish-action@v0.1.0 (GitHub Marketplace) — what this docs PR points users at
  • @looptech-ai/understand-quickly-cli@0.1.2 (npm)
  • @looptech-ai/understand-quickly-mcp@0.1.2 (npm, also listed at io.github.looptech-ai/understand-quickly on the MCP Registry)
  • understand-quickly@0.1.1 (PyPI)

The bundle@1 schema that backs the cdigest integration is now governed by the Code-Knowledge Graph Protocol v1 spec, so the sidecar shape the workflow snippet emits is locked in. The Marketplace Action handles the dispatch — no CLI change needed on cdigest's side, which is why this PR stays docs-only.

PR is rebased and the merge state is clean. Happy to address any further feedback whenever you have a moment.

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