feat: add document review workflow - #9
Conversation
Signed-off-by: Deathcharge <ward.andrew32@gmail.com>
Signed-off-by: Deathcharge <ward.andrew32@gmail.com>
|
Warning Review limit reached
Next review available in: 7 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
Summary by CodeRabbit
WalkthroughThe 0.2.0 release adds bounded workspace search, browser document import and preview, downloads, draft recovery, conflict handling, trusted-host validation, atomic file creation, updated documentation, tests, CI, and release metadata. ChangesDocument review release
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Reviewer
participant Browser
participant API
participant Workspace
Reviewer->>Browser: Search workspace or open document
Browser->>API: Request search or file content
API->>Workspace: Execute bounded operation
Workspace-->>API: Return matches or file state
API-->>Browser: Return JSON response
Browser-->>Reviewer: Render results, preview, or conflict action
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Deathcharge <ward.andrew32@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 12
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 55-56: Update the wheel smoke-test steps in the CI workflow to
execute from outside the repository checkout, preventing the editable
installation from resolving the source package. Assert that the output of the
samsarix-workspace CLI version command matches the installed samsarix-workspace
package version, rather than checking command success alone.
- Around line 23-25: Update the workflow steps using actions/checkout@v7 and
actions/setup-python@v7 to reference their full immutable commit SHAs, covering
all three `@v7` occurrences. Add persist-credentials: false to the
actions/checkout step.
In `@CONTRIBUTING.md`:
- Around line 8-9: Update the clone command in the contributor setup
instructions to use the canonical repository owner instead of the YOUR_USERNAME
placeholder, while keeping the subsequent directory change aligned with the
actual repository name.
In `@samsarix_workspace/api.py`:
- Around line 351-357: Update the write_file API documentation in
API_REFERENCE.md to explicitly describe guard precedence: for an existing path,
create_only returns already_exists before expected_etag validation; for a
missing path, any non-null expected_etag returns edit_conflict.
In `@samsarix_workspace/cli.py`:
- Around line 122-124: Update the wildcard_bind validation to reject
--allowed-host values that permit every host, including "*" and unsupported
wildcard forms beginning with "*.". Preserve acceptance of explicit host entries
and continue requiring at least one valid allowed host when binding to 0.0.0.0
or ::.
- Around line 121-127: Update host normalization in the CLI configuration and
request validation flow so configured and incoming hosts are compared
case-insensitively, and bracketed IPv6 authorities such as [::1]:8765 normalize
to ::1 rather than being split at the first colon. Preserve wildcard and
explicit allowed-host behavior, and add regression coverage for mixed-case
hostnames and bracketed IPv6 inputs.
In `@samsarix_workspace/shell.py`:
- Around line 105-106: Validate max_output_chars in VirtualShell.__init__ and
reject negative values before _bounded performs truncation; preserve the
existing behavior for zero and positive limits.
In `@samsarix_workspace/static/app.js`:
- Around line 578-590: Update downloadFile so URL.revokeObjectURL(url) runs in a
later task after link.click(), such as via setTimeout, rather than
synchronously. Keep the existing download setup and toast behavior unchanged.
- Around line 338-347: Update focusSearchMatch to convert the matched line’s
prefix and span from code-point offsets to JavaScript UTF-16 offsets before
calling setSelectionRange. Account for astral characters in preceding lines when
computing the absolute start, and in the matched text when computing the end,
while preserving the existing bounds clamping and editor focus behavior.
- Around line 440-467: Add a saving flag to the state object and have saveFile
return immediately when a save is already in progress. Set the flag before
invoking persistFile and clear it when the save completes, including failure
paths, so concurrent Ctrl+S actions cannot issue duplicate PUT requests.
In `@samsarix_workspace/workspace.py`:
- Around line 318-328: Update search_text() to use an internal bounded-read
helper with the remaining max_scan_bytes budget instead of unbounded
self.read_file(entry.path). Have the helper read at most the remaining budget
plus one byte, detect truncation before decoding, and account scanned_bytes
using the actual bytes read rather than entry.size; preserve existing handling
for binary, oversized, and read failures.
In `@tests/test_api.py`:
- Around line 96-98: Update the rejected /healthz test around client.get and the
status assertion to remove the exact response-text check, while retaining the
400 status assertion and verifying that the health route did not execute.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 53453b6f-f092-46b6-aa0b-97dc95377edc
📒 Files selected for processing (23)
.env.example.github/workflows/ci.ymlCHANGELOG.mdCONTRIBUTING.mdREADME.mdROADMAP.mdSECURITY.mddocs/API_REFERENCE.mddocs/GETTING_STARTED.mddocs/PRODUCTIZATION.mdpyproject.tomlsamsarix_workspace/__init__.pysamsarix_workspace/api.pysamsarix_workspace/cli.pysamsarix_workspace/shell.pysamsarix_workspace/static/app.csssamsarix_workspace/static/app.jssamsarix_workspace/static/index.htmlsamsarix_workspace/workspace.pytests/test_api.pytests/test_cli.pytests/test_shell.pytests/test_workspace.py
Signed-off-by: Deathcharge <ward.andrew32@gmail.com>
|
Addressed all 12 review threads in 7c4e574. Regression evidence includes 56 passing tests (plus one expected Windows FIFO skip), strict Ruff/mypy checks, bounded stale-metadata search coverage, mixed-case and bracketed-IPv6 Host coverage, immutable CI action pins, installed-wheel smoke testing outside the checkout, and headed Chromium proof for one-PUT duplicate Ctrl+S handling, exact astral-character selection, successful download, and a clean console. All review threads are resolved and all four CI matrix jobs are green. |
What changed
Why
Samsarix Workspace's strongest independent use case is a small local document/artifact review workspace—not a faux IDE. This milestone completes that job while preserving plain local files, no OS shell, no code execution, no cloud dependency, and no frontend supply chain.
User impact
Users can import a bounded set of notes, logs, configuration, code, or AI-generated text; search and navigate matches; safely preview Markdown; recover one tab draft; resolve external edits; and save or download the result.
Validation
pip checkpassArtifact digests are recorded in
docs/PRODUCTIZATION.md. Publication and hosted deployment remain explicitly out of scope.