Skip to content

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

Merged
fishmingyu merged 11 commits into
mainfrom
agent/pr591-producers
Aug 15, 2026
Merged

feat(storage): bind strict publication producers#620
fishmingyu merged 11 commits into
mainfrom
agent/pr591-producers

Conversation

@fishmingyu

@fishmingyu fishmingyu commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

Restack the strict publication producer work onto the focused workspace authority from #619 and the source, vector, atomic-cleanup, and resource-ownership foundations already merged to main.

This replacement removes the obsolete stacked history while preserving the producer contracts, authenticated repository reads, and static export hardening.

Changes

  • bound publishable JSON and metadata before DOM allocation
  • add the callback-scoped strict workspace provider contract
  • migrate static Wiki export to retained source authority and authenticated staged/published validation
  • route summaries, citations, graph excerpts, and codemap reads through the bounded repository-source reader
  • compare static-export manifests against a verified detached identity rather than mutable public projections
  • preserve first-failure and cancellation semantics across stage and source cleanup
  • document the strict producer boundary and remaining provider integration work

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

  • post-feat(storage): expose workspace publication gate #619 restack focused producer/export suite: 754 passed, 15 skipped

  • all 11 commits are range-diff equivalent to the original replacement stack

  • changed-range pre-commit hooks

  • git diff --check origin/main...HEAD

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

Supersedes the now-closed #591. #619 and its #622 resource-cleanup prerequisite are merged, and this branch is restacked directly onto current main.

@github-actions github-actions Bot added type/docs Documentation type/test Test-related scope/graph Code graph, igraph, ROI subgraph, SCIP decode labels Aug 13, 2026
@fishmingyu
fishmingyu force-pushed the agent/pr590-workspace branch from 13d3ecc to 9ac426a Compare August 15, 2026 21:57
Base automatically changed from agent/pr590-workspace to main August 15, 2026 22:03
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.
Bind static export manifest comparisons to a verified detached source identity instead of mutable public projections. Keep the restacked PID and publication-race regressions aligned with the hardened authority behavior.

Verified with the focused producer/export suite (734 passed, 15 skipped) and changed-file pre-commit hooks.
@fishmingyu
fishmingyu force-pushed the agent/pr591-producers branch from 0971030 to 0eeb10b Compare August 15, 2026 22:05
@fishmingyu
fishmingyu marked this pull request as ready for review August 15, 2026 22:10
@fishmingyu
fishmingyu merged commit bd4e661 into main Aug 15, 2026
17 checks passed
@fishmingyu
fishmingyu deleted the agent/pr591-producers branch August 15, 2026 22:13

@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: 0eeb10b4d4

ℹ️ 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 on lines +170 to +175
if os.path.isabs(candidate):
if not repo_dir:
return None
try:
candidate = os.path.relpath(candidate, os.path.abspath(repo_dir))
except ValueError:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Resolve relocated graph paths through the source reader

When a manifest is consumed from a checkout at a different absolute location than the one where its graph was built, graph vertices can still contain paths such as /old/build/repo/pkg/a.py. The authenticated reader deliberately maps these frozen absolute suffixes to captured files, but this helper instead computes a relative path against the current repo_dir, obtains ../../old/build/..., and marks every such symbol external. Static exports from relocated artifacts consequently publish an incorrect external-only hierarchy even though citations and source excerpts resolve successfully. Use the reader's captured-path mapping (or equivalent suffix resolution) rather than relpath against the current checkout.

Useful? React with 👍 / 👎.

Comment on lines +170 to +175
if os.path.isabs(candidate):
if not repo_dir:
return None
try:
candidate = os.path.relpath(candidate, os.path.abspath(repo_dir))
except ValueError:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Resolve captured graph paths with the source reader

When a manifest is consumed from a checkout at a different absolute location than the one where its graph was built, graph vertices can still contain paths such as /old/build/repo/pkg/a.py. The authenticated reader deliberately maps these frozen absolute suffixes to captured files, but this helper instead computes a relative path against the current repo_dir, obtains ../../old/build/..., and marks every such symbol external. Static exports from relocated artifacts consequently publish an incorrect external-only hierarchy even though citations and source excerpts resolve successfully. Use the reader's captured-path mapping (or equivalent suffix resolution) rather than relpath against the current checkout.

Useful? React with 👍 / 👎.

Comment on lines +979 to +983
stage = OwnedDirectoryStage.prepare(
output_dir,
required_destination_file=STATIC_EXPORT_MANIFEST,
allow_empty_destination=True,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore Windows-compatible static export staging

On Windows, every static export now fails when it reaches this call: OwnedDirectoryStage.prepare() requests _open_publication_authority(..., create_missing=True), whose Windows implementation rejects safe parent creation unconditionally, and the stage itself subsequently relies on POSIX-only directory descriptors and flags. The previous tempfile.mkdtemp plus platform-specific publish_staged_directory path supported Windows, so switching the exporter to this POSIX stage removes the feature for all Windows users even when the output parent already exists.

Useful? React with 👍 / 👎.

Comment thread codenib/wiki/builder.py
Comment on lines +280 to +285
cache_key = (source_path, start_line, stop_line)
if cache_key not in cache:
payload = self._source_reader.read_line_range(
source_path,
start_line=start_line + 1,
end_line=stop_line,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid rehashing a file for every indexed symbol

For source-bound exports, the cache is keyed by the exact symbol range, so each distinct symbol in the same file calls read_line_range() again. That method authenticates by reading and hashing the complete file, making _compute_symbols() perform O(symbol-count × file-size) I/O; for example, a large generated file containing hundreds of indexed symbols is reread hundreds of times before page ranking even limits what will be published. Group ranges or authenticate each file once while retaining the bounded excerpts needed for its symbols.

Useful? React with 👍 / 👎.

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