Skip to content

feat(export): native Open Knowledge Format (OKF) v0.2 bundle support - #624

Open
d-oit wants to merge 20 commits into
mainfrom
feat/okf-bundle-export-import-17257068464195044926
Open

feat(export): native Open Knowledge Format (OKF) v0.2 bundle support#624
d-oit wants to merge 20 commits into
mainfrom
feat/okf-bundle-export-import-17257068464195044926

Conversation

@d-oit

@d-oit d-oit commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Introduces native Open Knowledge Format (OKF) v0.2 bundle export/import support in the Knowledge Studio. Built native client-side zip creation/extraction, structured Zod schemas, provenance/attribution stable footnotes, trust evaluation, update logging, and Conformance §11 robust error-handling/passthroughs. Fully verified with Jest/Vitest test suites and repository quality gates.

Fixes #623


PR created automatically by Jules for task 17257068464195044926 started by @d-oit

Introduces native OKF v0.2 bundle support in the studio:
- Structured Zod validation schemas matching Google Cloud's OKF v0.2 spec in types.ts.
- Export engine converting studio entities, claims, and edges to zipped Markdown bundles in bundle.ts.
- Import engine reconstructing studio data from zipped OKF bundles in import.ts.
- Trust tier and staleness evaluation helpers in trust.ts.
- Native integration in export-types.ts, use-export-handlers.ts, and UI views.
- Comprehensive unit and integration test coverage.
- New ADR 031 documenting the design decision.

Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
do-knowledge-studio Ready Ready Preview, v0 Aug 9, 2026 8:16pm

@github-actions github-actions Bot added documentation Documentation improvements config tests Related to automated/manual tests labels Aug 8, 2026
@deepsource-io

deepsource-io Bot commented Aug 8, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 63558b9...f2fd442 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Aug 9, 2026 8:15p.m. Review ↗
Python Aug 9, 2026 8:15p.m. Review ↗
Shell Aug 9, 2026 8:15p.m. Review ↗
SQL Aug 9, 2026 8:15p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

Comment thread src/components/studio/views/use-export-handlers.ts Outdated
Comment thread src/components/studio/views/use-export-handlers.ts Outdated
Comment thread src/lib/okf/bundle.ts Outdated
Comment thread src/lib/okf/bundle.ts Outdated
Comment thread src/lib/okf/bundle.ts Outdated
Comment thread src/lib/okf/import.ts Outdated
Comment thread src/lib/okf/import.ts Outdated
Comment thread src/lib/okf/trust.test.ts Outdated
Comment thread src/lib/okf/trust.test.ts Outdated
Comment thread src/lib/okf/trust.ts Outdated

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 2 new finding(s).

Comment thread src/lib/okf/import.ts Outdated
Comment thread src/lib/okf/import.ts Outdated
@codacy-production

codacy-production Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 104 complexity · 2 duplication

Metric Results
Complexity 104
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Introduces native OKF v0.2 bundle support in the studio:
- Structured Zod validation schemas matching Google Cloud's OKF v0.2 spec in types.ts.
- Export engine converting studio entities, claims, and edges to zipped Markdown bundles in bundle.ts.
- Import engine reconstructing studio data from zipped OKF bundles in import.ts.
- Trust tier and staleness evaluation helpers in trust.ts.
- Native integration in export-types.ts, use-export-handlers.ts, and UI views.
- Comprehensive unit and integration test coverage.
- New ADR 031 documenting the design decision.

Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>
Introduces native OKF v0.2 bundle support in the studio:
- Structured Zod validation schemas matching Google Cloud's OKF v0.2 spec in types.ts.
- Export engine converting studio entities, claims, and edges to zipped Markdown bundles in bundle.ts.
- Import engine reconstructing studio data from zipped OKF bundles in import.ts.
- Trust tier and staleness evaluation helpers in trust.ts.
- Native integration in export-types.ts, use-export-handlers.ts, and UI views.
- Comprehensive unit and integration test coverage.
- New ADR 031 documenting the design decision.

Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 1 new finding(s).

Comment thread src/lib/okf/import.ts Outdated
Introduces native OKF v0.2 bundle support in the studio:
- Structured Zod validation schemas matching Google Cloud's OKF v0.2 spec in types.ts.
- Export engine converting studio entities, claims, and edges to zipped Markdown bundles in bundle.ts.
- Import engine reconstructing studio data from zipped OKF bundles in import.ts.
- Trust tier and staleness evaluation helpers in trust.ts.
- Native integration in export-types.ts, use-export-handlers.ts, and UI views.
- Comprehensive unit and integration test coverage.
- New ADR 031 documenting the design decision.

Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>
Comment thread src/components/studio/views/use-export-handlers.ts
Comment thread src/lib/okf/bundle.ts
Comment thread src/lib/okf/bundle.ts
Comment thread src/lib/okf/import.ts
Comment thread src/lib/okf/import.ts
Comment thread src/lib/okf/import.ts

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 2 new finding(s).

Comment thread src/components/studio/views/use-export-handlers.ts
Comment thread src/lib/okf/import.ts Outdated
Comment thread src/components/studio/views/use-export-handlers.ts

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 1 new finding(s).

Additional findings:

  • [LOW · hunter] 'unsafe-inline' in CSP for Encrypted Reader (src/lib/export/encrypt.ts:147)

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 1 new finding(s).

Comment thread src/components/studio/views/use-export-handlers.ts Outdated
Ensure that the main navigation sidebar is fully visible and hydrated before running tests that press Control+K, preventing timing-related event drop flakiness.

Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>
Comment thread src/components/studio/views/use-export-handlers.ts Outdated
Comment thread src/components/studio/views/use-export-handlers.ts Outdated
Comment thread src/lib/okf/bundle.ts Outdated
Comment thread src/lib/okf/bundle.ts Outdated
Comment thread src/lib/okf/bundle.ts Outdated
Comment thread src/lib/okf/import.ts Outdated
Comment thread src/lib/okf/import.ts Outdated
Comment thread src/lib/okf/trust.test.ts Outdated
Comment thread src/lib/okf/trust.test.ts Outdated
Comment thread src/lib/okf/trust.ts Outdated

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 1 new finding(s).

Comment thread src/lib/okf/import.ts
Comment thread src/components/studio/views/use-export-handlers.ts
Comment thread src/lib/okf/bundle.ts
Comment thread src/lib/okf/bundle.ts
Comment thread src/lib/okf/import.ts
Comment thread src/lib/okf/import.ts
Comment thread src/lib/okf/import.ts

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 1 new finding(s).

Comment thread src/components/studio/views/use-export-handlers.ts

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 1 new finding(s).

Comment thread src/components/studio/views/use-export-handlers.ts
Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 2 new finding(s).

Comment thread src/components/studio/views/use-export-handlers.test.ts
Comment thread src/lib/okf/import.ts
Comment thread src/components/studio/views/use-export-handlers.ts

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 1 new finding(s).

if (errors.length > 0 && ents.length === 0) {
toast.error('Import failed', { description: errors.join('; ') })
return
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🦉 OwlWatch [LOW · tracker] Partial import error message truncation

Partial import errors could be truncated or misleading when joined as a single string.

@d-oit
d-oit force-pushed the feat/okf-bundle-export-import-17257068464195044926 branch from 9056d89 to f2fd442 Compare August 9, 2026 20:15

@owl-watch owl-watch 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.

🦉 OwlWatch reviewed this change — 1 new finding(s).

Comment thread src/lib/okf/import.ts
* @param files - Map of bundle-relative path → file content.
* @returns Entities, claims, and any non-fatal parse errors.
*/
export const parseOkfBundle = (files: Map<string, string>): OkfImportResult => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🦉 OwlWatch [MEDIUM · tracker] Missing bundle validation in parseOkfBundle

The parseOkfBundle function fails to validate the okf_version within the index.md file, delegating this crucial validation to the UI layer and making the library vulnerable to processing arbitrary or incompatible files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config documentation Documentation improvements tests Related to automated/manual tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(export): Native Open Knowledge Format (OKF) v0.2 bundle export/import support

1 participant