Skip to content

feat(studio): data integrity, storage health, and shared core (plans/217) - #1178

Merged
d-oit merged 7 commits into
mainfrom
feat/data-integrity-storage
Nov 19, 2026
Merged

d-oit merged 7 commits into
mainfrom
feat/data-integrity-storage

Conversation

@d-oit

@d-oit d-oit commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Implements the data-integrity and storage-health group of plan 217 (plans/217-open-issues-2026-11-17.md):

Foundation for #1170: introduces packages/dks-core, the framework-neutral shared domain services (markdown/OKF parsing, BM25 retrieval, graph path, backup verification, zip) consumed by the PWA behind stable module facades (src/lib/search/retrieval.ts, src/lib/import, src/lib/okf). No behavior change beyond the fixes above; CLI/MCP/CLI-docs consumers land in the following PRs of the plan.

Note: dks-core has no runtime dependencies beyond yaml; the pnpm upgrade and Node matrix land in the following plan-217 PRs, so this PR stays on the current pinned toolchain.

…217 #1155-#1159,#1170)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
do-knowledge-studio Ready Ready Preview, v0 Nov 19, 2026 8:21am UTC

@github-actions github-actions Bot added documentation Documentation improvements config tests Related to automated/manual tests scripts labels Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Blocked merge diagnosis — blocked
⏳ Check run(s) still in progress: ["Codacy Static Code Analysis","Stale Base Guard","Diagnose Blocked Merge State","Detect Changes","YAML Syntax Validation","GitHub Actions Workflow Validation","Dependency Advisory Audit","Shell Script Security Analysis","Trivy Filesystem Security Scan","Performance Benchmarks (advisory)","Infrastructure as Code Security","commitlint","Secret Detection","labeler","Analyze (javascript-typescript)","Analyze (actions)","Analyze (python)"]

@codacy-production

codacy-production Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 582 complexity · 23 duplication

Metric Results
Complexity 582
Duplication 23

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.

Comment thread packages/dks-core/src/markdown.ts Fixed
Comment thread packages/dks-core/src/markdown.ts Fixed
Comment thread packages/dks-core/src/okf-parse.ts Fixed
Comment thread packages/dks-core/src/okf-parse.ts Fixed
Comment thread packages/dks-core/src/okf-parse.ts Fixed
…ild dks-core before test typechecks

The global link regexes are polynomial on adversarial notes; replace them with hand-rolled linear scanners pinned by differential property tests against the reference regexes, make the vitest configs consume dks-core from source so fresh CI checkouts typecheck without a package build, and stop shipping test files in the package build output.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- frontmatter: build mappings as Map + Object.fromEntries so literal
  __proto__/constructor keys stay plain data (regression test added,
  verified failing against the old bracket-assignment code)
- frontmatter/markdown/okf-export: charAt/.at() accessors and Set.has
  instead of index-bracket lookups (satisfies strict
  noUncheckedIndexedAccess and Codacy's no-unnecessary-condition)
- backup: Map-based payload lookups (own-property-only, no prototype
  reads), Uint8Array.from for base64 decode, String() in template
- okf-export: drop dead e.content ?? '' (content is non-optional)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
The fs port contract is core; the Node implementation belongs to its
only runtime consumer (the dks CLI, landing with the CLI/MCP group).
PR1 shipped nodeFsPort/nodeFsWriterPort with test-only consumers, which
both violates no-dead-code scoping and exposes node:fs calls to Codacy's
syntactic detect-non-literal-fs-filename engine (suppression paths are
unavailable: read-scoped API token, standard-enforced pattern — see
plans/217 for the full disposition). bundle-load keeps the port-injected
logic and its test doubles unchanged.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
…omb caps

Adversarial review of PR #1178: 0 P1, 3 P2 — all fixed; P3 pins included.

- restore the original 41-word stop-word list (the port silently swapped
  it for a generic 90-word list, inverting searchability and BM25
  inputs); discriminating test verified failing against the generic list
- parse import-path frontmatter with the yaml package
  (parseFrontmatterYaml) — parity with the pre-shared-core importer
  (block scalars, anchors, multi-line values); parity pin test verified
  failing against the subset parser; subset parser stays the documented
  zero-dependency fallback
- readZip gains optional pre-inflation caps (declared-size checks +
  inflateRawSync maxOutputLength); bundle-load passes the bundle limits
  during extraction so hostile zips cannot allocate unbounded memory;
  three bomb-shaped tests added
- merge-entities test comment now states exactly what it pins; encrypted
  backup gains a hash-before-decrypt order pin; dependency-free doc
  claims corrected

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
CI's eval run red on the stop-word restoration exposed a second drift:
the port had also dropped the length > 2 minimum-token filter and its
non-ASCII exception (the generic stop list had been compensating for
both). Restoring the rule plus the list makes the shared engine rank the
large-corpus fixture identically to main; the snippet-bound fixture
returns to main's 'long' query shape (a 1-char query only worked under
the missing rule).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>

This branch was successfully deployed

1 active deployment
Preview — 4f2a9e53 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config documentation Documentation improvements scripts tests Related to automated/manual tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants