Skip to content

feat: upgrade OINK to 1.1 with maintainable site extensions - #496

Merged
imbajin merged 13 commits into
masterfrom
oink-1.1
Sep 25, 2026
Merged

imbajin merged 13 commits into
masterfrom
oink-1.1

Conversation

@imbajin

@imbajin imbajin commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Upgrade OINK 1.0 to 1.1 and keep HugeGraph customizations on the theme's sidebar and search-tail APIs. The theme owns rendering and keyboard interactions; HugeGraph retains version/locale preferences, consent-gated Ask AI and cancellation/focus handling.

  • Preserve Print's plain/book contract and inherit generic Chinese translations. Migrate existing sidebar preferences without changing the initial TOC state.
  • Make theme upgrades repeatable through go.mod/go.sum, reviewed layout/asset/translation/data fingerprints, resumable checksum cleanup, actionable diagnostics and regression gates. Keep version-independent module-graph checks in the workflow.
  • Settle Kapa API failures and refresh stale search rows before activation, so fast edits submit the current query and the consent dialog survives the palette debounce.
  • Reduce avoidable CI queueing and support the download action's single-version artifact layout without relaxing artifact identity checks.

All review threads on #496 and the four follow-ups from #497's review have been checked and answered; valid findings are fixed, and non-applicable suggestions include source evidence.

Validation and rollout

Current-head CI passes at dc982f312, including the documentation/test-message cleanup.

  • CI at d7063e34a passes: 193 Python tests, 40 UI unit tests, 7 workflow contracts, 76 Chromium tests (including enabled consent and disabled EN/CN rollback), and 8 visual checks. PR publication was skipped as intended. Strict local enabled/disabled builds and focused browser checks also pass.
  • Three independent reviewers completed the combined review and re-reviewed fixes. All 13 threads on feat: upgrade OINK to 1.1 with maintainable site extensions #496 and four follow-ups on fix(build): resolve OINK from candidate lock files #497 are resolved; feat: upgrade OINK to 1.1 with maintainable site extensions #496 was rechecked at the current head.
  • Consent-gated Ask AI is enabled by default, with the staging-tested Kapa/hCaptcha CSP in the root output. After merge and publication, master will render the AI entry points and permit required hosts. The production origin is already on Kapa's enabled-domain list. This PR remains unmerged and production has not been published.
  • Full staging 36081906211 restored candidate 32acb50196503f74f74da017721d14a2ca3b63f3 after a successful AI-off rollback. Actual desktop/mobile EN/CN answers, group filtering, consent/failure/retry, historical notices and the HugeGraph icon have staging evidence in [Feature] Enable Ask AI with Kapa: Source Groups, ASF CSP, and Privacy Compliance #495.
  • Production source migration: all 192 official document URLs pass preflight and share the PR content tree. CN has96 deployed production pages and a successful real answer citing official CN pages/sections. EN has been configured for the official origin, at last observation its reindex task was still running with the previous96 items retained; a real EN answer still cited staging at the last observation. Browser access has recovered. A fresh EN conversation still returns staging citations; the saved production crawl settings are correct, but the same reindex remains in progress with0 updates at the latest check. Existing staging CSP is a deployment precedent, not a separate domain-approval record.

Maintenance: OINK upgrade SOP · Kapa rollout.

Before / after

Chinese desktop (dark)
OINK 1.0 OINK 1.1
Before: Chinese desktop After: Chinese desktop
Chinese mobile drawer (dark)
OINK 1.0 OINK 1.1
Before: mobile drawer After: mobile drawer

- adopt OINK 1.1 sidebar and search extension APIs
- reconcile print overrides and inherit upstream translations
- add reviewed upgrade tooling and compatibility checks
- refresh maintenance docs and regression coverage
- configure verified English and Chinese source groups
- document consent, staging checks and rollout blockers
- accept blank module checksum lines without relaxing checks
- consolidate module lock regression coverage
- allow superseded runs to cancel gates and reports
- combine assembly and browser checks on one runner
- preserve required checks and publication permissions
- test failure gates and document queue behavior

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 2 Medium severity

Open (2)
What changed in this PR

Upgrades the site’s OINK theme dependency to v1.1.0 and refactors HugeGraph customizations to rely on OINK’s public extension APIs, while adding an explicit, review-gated upgrade workflow and strengthening regression coverage.

Changes:

  • Update OINK module pin (go.mod/go.sum) and adopt the new sidebar/search-tail public APIs in site JavaScript.
  • Add an “OINK upgrade SOP” + update-oink command that fingerprints reviewed upstream files and runs full validation gates.
  • Refresh and expand UI/E2E tests and CI workflow structure to match the new sidebar/search behavior and the upgraded print contract.
File Description
tests/​ui-ai/​ui-contract.test.cjs Updates contract assertions to ensure OINK public APIs are used (no legacy patches).
tests/​ui-ai/​sidebar-persistence.test.cjs Adds focused unit coverage for sidebar state persistence via OinkSidebar API.
tests/​ui-ai/​kapa-adapter.test.cjs Updates adapter tests for native search-tail registration + cancellation/focus behavior.
tests/​e2e/​workflow-contract.test.cjs Updates workflow contract expectations and adds new checks around cancellation/gating.
tests/​e2e/​visual.spec.js Stabilizes screenshots (fonts ready + animations disabled) and updates collapsed sidebar assertion.
tests/​e2e/​theme-upgrade.spec.js Adds upgrade regression coverage: print output correctness, no-JS nav, blocked storage behavior.
tests/​e2e/​search-ranking.spec.js Splits ranking cases into individual tests for clearer budgets and failures.
tests/​e2e/​platform.spec.js Aligns platform checks with OINK 1.1 sidebar/drawer inert/focus behaviors.
tests/​e2e/​package.json Runs new theme-upgrade spec in CI browser suite.
tests/​e2e/​ai.spec.js Switches AI-row selection to native option rows; adds keyboard/IME/cancellation coverage.
scripts/​versioning.py Switches to download_locked() for theme module resolution and integrity checks.
scripts/​update_oink.py New review-gated upgrade command that fingerprints upstream surfaces and runs full validation gates.
scripts/​update-oink.sh Shim wrapper to run the Python upgrade tool consistently.
scripts/​test_oink_upgrade.py Unit tests for upgrade preflight/review gating and baseline update behavior.
scripts/​test_oink_module.py Unit tests for strict module lock verification (no replace/exclude, checksum match, minimal graph).
scripts/​test_download_data.py Adjusts i18n expectations and adds rendered-output verification for inherited theme labels.
scripts/​oink_module.py New helper to strictly resolve/download/verify the pinned OINK module from go.mod/go.sum.
scripts/​oink-upgrade.md Adds SOP documentation for upgrade/review/rollback and maps customizations to regression evidence.
scripts/​oink-overrides.json Adds reviewed baseline fingerprints for upstream files relevant to overrides/extensions.
scripts/​kapa-rollout.md Adds rollout runbook for staged Kapa enablement, consent/CSP validation, and evidence requirements.
layouts/​_partials/​shell/​toc.html Updates comment/version annotation for the reviewed upstream base.
layouts/​_partials/​shell/​sidebar-panel.html Updates override header to reflect review against OINK v1.1.0.
layouts/​_partials/​shell/​config.html Updates override header to reflect review against OINK v1.1.0.
layouts/​_partials/​print/​page-content.html Updates print partial to return plain/book dict per OINK 1.1 contract and avoid parallel render races.
layouts/​_partials/​navbar.html Removes sidebar restore button markup now handled by OINK shell behavior.
layouts/​_partials/​navbar-item.html Updates override header to reflect review against OINK v1.1.0.
layouts/​_partials/​hooks/​body-end.html Removes labels no longer needed due to native theme search-tail rendering.
i18n/​zh-CN.yaml Reduces to HugeGraph-specific labels; relies on OINK for generic zh-CN UI strings.
i18n/​en.yaml Removes now-inherited UI strings (e.g., assets download row label).
hugo.yaml Records verified Kapa source-group IDs while keeping production AI disabled.
go.mod Pins OINK to v1.1.0.
go.sum Updates checksums for OINK v1.1.0 pin.
contribution.md Updates contributor guidance for module verification and adds CI queue/rerun notes.
assets/​scss/​_styles_project.scss Removes CSS for now-native sidebar restore and ask-ai search-tail row.
assets/​js/​kapa-adapter.js Refactors AI integration to register native search-tail extension; adds cancellation/focus/settlement handling.
assets/​js/​hugegraph-shell.js Refactors sidebar persistence to use OinkSidebar public API; removes sidebar inert/overlay patching.
README.md Updates module verification instructions and documents the upgrade command.
NOTICE Removes hard-coded OINK version reference.
AGENTS.md Replaces outdated assistant guidance with current entry points, constraints, and validation expectations.
.github/​workflows/​hugo.yml Updates module verification step, merges assembly + browser checks onto one runner, improves cancellation behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread assets/js/kapa-adapter.js Resolved
Comment thread scripts/versioning.py Resolved
- incorporate the reviewed master prerequisite
- retain baseline verification and its module lock checks
- preserve the already validated candidate file tree
- handle single-match artifact download layout
- retain metadata identity and source SHA validation
- reject flat inputs for multi-version assembly
- cover staging layout and invalid metadata
- use the declared artifact version selection
- keep historical print checks for full builds
- validate latest-only browser checks locally

@bitflicker64 bitflicker64 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Blocking: no. Summary: The OINK 1.1 migration uses the tagged sidebar and search-tail APIs as documented, the Print override matches the upstream plain/book contract, and the flattened-artifact fallback is limited to a single selected version. Two minor issues are in the new upgrade tooling: the CI baseline check reports any local override addition as an upstream change without naming the file, and the upgrade command leaves the previous version's checksums in go.sum. Evidence: diff a5a9861..67e73b5; go mod download -json github.com/pgsty/oink@v1.1.0 returns the go.sum hash; OINK v1.1.0 sidebar-state.js and command-palette.js read for the API contracts; update_oink.py --check-baseline passes at head and fails after copying upstream layouts/_partials/breadcrumb.html unchanged into the site; go get github.com/pgsty/oink@v1.0.0 on a copy of go.mod/go.sum leaves four go.sum lines; node --test tests/ui-ai/*.test.cjs (35 pass), test_oink_upgrade and the two changed test_versioning cases pass; the Build and deploy site run on this head is green.

Comment thread scripts/update_oink.py Resolved
Comment thread scripts/update_oink.py Resolved
@imbajin
imbajin requested a balanced review from Copilot September 23, 2026 08:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread assets/js/kapa-adapter.js Resolved
Comment thread .github/workflows/hugo.yml Resolved
Comment thread .github/workflows/hugo.yml Resolved
Comment thread assets/js/kapa-adapter.js Resolved

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Blocking: no. Summary: The review found a gap in the new OINK override inventory and an unsettled activation path if opening Kapa throws. Evidence: Exact-head static review of scripts/update_oink.py and assets/js/kapa-adapter.js; the latest Build and deploy site workflow succeeded.

Comment thread scripts/update_oink.py Resolved
Comment thread assets/js/kapa-adapter.js Resolved

@bitflicker64 bitflicker64 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Blocking: yes. Summary: The last commit (014e012, "docs(goal): temporary handoff ...") force-adds 16 files under .goal-task/, a path that .gitignore excludes. They include about 19 MB of generated PNGs and an agent handoff note. That note says the directory must be removed from the branch before merge. The OINK 1.1 migration itself raised no new finding. Evidence: git ls-tree -r -l 014e0121 .goal-task totals 19,075,787 bytes, 11 of them PNG files of 1.4 to 2.3 MB each. .gitignore:37 is /.goal-task. At this head in a temporary worktree, python3 scripts/update_oink.py --check-baseline reported that the baseline matches. python3 -m unittest test_oink_upgrade passed 7 of 7, node --test ../ui-ai/*.test.cjs passed 35 of 35, and node --test workflow-contract.test.cjs passed 6 of 6. All CI jobs at this head succeeded.

Comment thread .goal-task/oink-1.1-guide/handoff.md Resolved

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Blocking: no. Summary: The search-tail action can submit stale text after edits, and the TOC disclosure state no longer persists. Evidence: Static inspection of the pinned OINK v1.1.0 command-palette and sidebar APIs plus the changed adapter and selector.

Comment thread assets/js/kapa-adapter.js Resolved
Comment thread assets/js/hugegraph-shell.js Resolved
- settle Kapa failures and activate the current search query
- migrate sidebar preferences while preserving aside defaults
- improve locked module diagnostics and resumable checksum cleanup
- cover data overrides and retain workflow module graph checks
- replace the widget placeholder with the existing site logo
- keep the logo request on the current site origin
- cover the explicit widget logo attribute
- raise the widget modal above the site launcher layer
- prevent the mobile launcher from covering the query input
- verify the supported modal layer configuration
- describe scoped HTML crawling and language groups
- preserve old uploads in Legacy for recovery
- distinguish staging citations and content provenance
- enable Kapa with the staging-tested CSP hosts
- preserve consent gating and ASF default policy
- verify disabled rollback fixtures in CI and upgrades
- document pending production citation checks
- align rollout instructions with enabled defaults
- document enabled and disabled browser coverage
- include the rollback fixture port in upgrade setup
- remove the obsolete search test phase label
- use official English and Chinese documentation origins
- verify content parity before changing crawl sources
- keep current indexing evidence in the rollout issue
@imbajin
imbajin merged commit cd6e442 into master Sep 25, 2026
10 checks passed
@imbajin
imbajin deleted the oink-1.1 branch September 25, 2026 09:43
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.

4 participants