Skip to content

feat(storage): bind strict publication producers - #591

Draft
fishmingyu wants to merge 10 commits into
fix/strict-publication-foundations-v2from
fix/strict-publication-producers-v2
Draft

feat(storage): bind strict publication producers#591
fishmingyu wants to merge 10 commits into
fix/strict-publication-foundations-v2from
fix/strict-publication-producers-v2

Conversation

@fishmingyu

@fishmingyu fishmingyu commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

Bind strict publication producers to bounded metadata validation, callback-scoped directory readers, retained repository-source authority, and an exact trusted workspace-provider contract.

This is a stacked PR based on #590. It does not yet add the strict BM25 or context-artifact producer; those remain separate because they must reconcile the newer portable-inert native authorization contract.

Changes

  • bound publishable JSON bytes, lexical tokens, nodes, depth, keys, strings, and atoms before DOM allocation; require UTF-8 without a BOM and validate case-insensitive JSON suffixes
  • migrate static Wiki export to one OwnedDirectoryStage generation with authenticated frontend copying and exact staged/published reader validation
  • retain one source-fingerprint-v2 binding across summaries, snippets, graph metadata, and source citations, then verify and close it before publication
  • remove ambient Git-origin provenance from static export identities while preserving the interactive Wiki default
  • bind strict workspace sessions to exact request, plan, destination expectation, PID, and one-shot provenance before any user callback or write
  • serialize writes, validation, publication, revocation, and provider callback lifecycle through cancellation-safe gates
  • preserve the first build or cancellation failure when stage/source cleanup also fails
  • document the local compatibility boundary and the still-unwired strict provider milestone

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Performance improvement
  • Tests

Testing

  • Tests pass locally
  • Added new tests for the changes
  • pytest -q test/test_atomic_directory.py test/test_captured_directory.py test/test_workspace_provider.py test/test_bounded_json.py test/artifacts/test_publish.py test/test_source_fingerprint.py test/test_repository_summary.py test/wiki/test_builder.py test/web/test_static_export.py test/web/test_repo_registry.py test/web/test_codemap.py test/graph/test_hierarchy.py --tb=short (569 passed, 15 skipped)
  • independent frozen-diff adversarial review: 348 passed, 5 skipped; PID/concurrency/zero-publication matrix repeated 10 times (70 passed)
  • unit tier excluding two known incomplete-litellm environment files: 4679 passed, 31 skipped; the 17 remaining failures all require attributes absent from this checkout's namespace-only litellm installation and are unrelated to this diff
  • Black, isort with the Black profile, flake8, py_compile, and git diff --check on the changed surface

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Dependency: #590 is published, mergeable, and green but intentionally not merged yet. This PR remains draft until its updated remote checks complete.

@github-actions github-actions Bot added type/docs Documentation type/test Test-related labels Aug 11, 2026
@fishmingyu
fishmingyu marked this pull request as draft August 11, 2026 22:08
@fishmingyu

Copy link
Copy Markdown
Member Author

Temporarily returned to Draft after adversarial review found four release-blocking gaps: retained source authority for static export, pre-DOM JSON complexity bounds, workspace session revocation serialization, and destination expectation enforcement. Fixes and deterministic regressions are in progress. Dependent PR #592 is also Draft until this layer is revalidated.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2bc21fbf4e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codenib/_workspace_provider.py Outdated
Comment thread codenib/web/static_export.py Outdated
Comment thread codenib/artifacts/security.py Outdated
Comment thread codenib/_workspace_provider.py
@github-actions github-actions Bot added the scope/graph Code graph, igraph, ROI subgraph, SCIP decode label Aug 11, 2026
@fishmingyu

Copy link
Copy Markdown
Member Author

The draft blockers from the previous review are now closed in f9f9fa8..b0b508e:

  • JSON is complexity-bounded before DOM parsing and .JSON is validated.
  • workspace callbacks are PID-bound, destination-expectation-bound, provenance-bound, and linearized with revocation.
  • static source reads retain and reverify one source-v2 authority through generation; cleanup failures prevent publication.
  • static repository identity no longer depends on ambient Git origin.

Independent final review of the frozen 20-file diff reported P0/P1/P2 = 0/0/0. The PR remains Draft while the new remote checks run and while #592 is restacked.

@fishmingyu
fishmingyu marked this pull request as ready for review August 11, 2026 22:57

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0b508e836

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codenib/source_fingerprint.py Outdated
Comment thread codenib/source_fingerprint.py Outdated
@fishmingyu
fishmingyu marked this pull request as draft August 11, 2026 23:49
Preserve exact provider callback outcomes, authenticate manifest containment, reroot frozen source paths, and support universal newlines without publication drift.

Verified with 319 relevant tests, Python 3.12/3.13 compatibility checks, adversarial path tests, and static checks.
@fishmingyu
fishmingyu force-pushed the fix/strict-publication-producers-v2 branch from b0b508e to 0fb85b1 Compare August 12, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/graph Code graph, igraph, ROI subgraph, SCIP decode type/docs Documentation type/test Test-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant