Commit graph

26 commits

Author SHA1 Message Date
Fade78
e69757ccab Remove chmod from command whitelist
chmod has no legitimate use case in Fileshed context:
- File permissions are managed by Fileshed's own system (zones, groups, modes)
- Unix permissions are never exposed to users via the API
- Allowing chmod creates a security risk (executable scripts)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:38:14 +01:00
Fade78
f1ef5e614d Update external security reviews for v1.0.5
- Updated ChatGPT 5.2 Instant review
- Updated Claude Opus 4.5 Thinking review

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 16:47:15 +01:00
Fade78
0664545b27 Bump version to 1.0.5 - NFS compatibility
- Add sqlite_journal_mode valve for NFS-safe SQLite operations
- Extract _apply_sqlite_journal_mode() helper (DRY)
- Add NFS deployment documentation in SPEC.md
- Add 5 tests for journal modes (1196-1200)
- Update test count to 1200

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 16:38:31 +01:00
Fade78
56b4c000e7 Created ZIP: docs.zip 2026-01-31 16:16:13 +01:00
Fade78
9d42f512b5 Created ZIP: docs.zip 2026-01-31 15:57:05 +01:00
Fade78
84b4a6925e Fix README discrepancies
- Fix test count: 1101 → 1195
- Fix ChatGPT rating: 5/5 → 4.5/5 (matches audit report)
- Fix operation count in example: 10 → 9
- Fix typo: anthopic → anthropic (filename + link)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:48:39 +01:00
Fade78
5a617330d6 Bump version to 1.0.4
- Update version in Fileshed.py
- Update README badges (version + tests count 1195)
- Update Exec_tests.md version

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:44:59 +01:00
Fade78
e22493ef19 Update Exec_tests.md: 1195/1195 tests passed
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:38:43 +01:00
Fade78
de4fa161a7 Add mono-instance concurrency protections (C3-C6)
- C3: FS/DB atomicity with rollback on shed_rename, orphan cleanup in shed_maintenance
- C4: SQLite WAL mode for better concurrent read/write performance
- C5: Git lock (fcntl.flock) for group operations to prevent index corruption
- C6: SQLite retry with exponential backoff (3 retries, 0.1/0.2/0.4s delays)

Also: Change xxd to od in README features (xxd not in container)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:47:52 +01:00
Fade78
dc7e29f8de Remove Qwen3 30B and GPT-OSS 20B audit reports
Keep only the two major model audits:
- ChatGPT 5.2 Instant (4.5/5)
- Claude Opus 4.5 Thinking (4/5)

Updated README and release notes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:35:53 +01:00
Fade78
e91b6d741f Add overwrite parameter to bridge functions, fix import hint
Bridge functions:
- shed_move_uploads_to_storage: Added overwrite=False parameter
- shed_move_uploads_to_documents: Added overwrite=False parameter
- shed_copy_storage_to_documents: Added overwrite=False parameter
- shed_move_documents_to_storage: Added overwrite=False parameter
- shed_copy_to_group: Added overwrite=False parameter
- FILE_EXISTS errors now hint "Use overwrite=True to replace"

Import hint fix:
- Removed import_all=True from hint (let user choose)

Tests: 1101 tests passing (+10 for bridge overwrite)
Docs: Updated FUNCTION_HELP, README function table

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:07:18 +01:00
Fade78
106d0d5409 Add shed_create_file hint, fix SQL case-insensitive validation, add security tests
- shed_create_file: Add pedagogical hint explaining it's a wrapper
- SQL security: Convert query to uppercase before pattern matching (fixes case bypass)
- Tests: Add 5 SQL security tests (1087-1091) for case-insensitive validation
- Docs: Fix function count (37→38), add shed_create_file to SPEC.md
- README: Update test badge (1086→1091)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:01:56 +01:00
Fade78
17b3d8b46f Add shed_create_file function and overwrite param for shed_patch_bytes
New function: shed_create_file(zone, path, content, file_type='text')
- Simplest way to create/overwrite a file
- Supports both text and bytes (file_type parameter)
- For bytes: content_format='hex', 'base64', or 'raw'
- Delegates to shed_patch_text/bytes with overwrite=True

Also added overwrite parameter to shed_patch_bytes for consistency
with shed_patch_text.

Function count: 37 → 38

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:33:50 +01:00
Fade78
e1c234b508 Add LLM Guardrails: type validation with helpful error messages
Validates parameter types before use to prevent TypeError/AttributeError
when LLMs pass wrong types (e.g., "" instead of None, 0 instead of ""):

- max_output, timeout: validate int type
- line, end_line: validate int type in shed_patch_text
- offset, length: validate int type in shed_patch_bytes and shed_hexdump
- regex_flags: validate string type
- to (shed_convert_eol): validate string type

Each error message includes:
- Parameter name
- Received value with type
- Expected format
- Concrete example in hint

Also adds LLM Guardrails section to SPEC.md explaining the rationale:
minimize round-trips by making errors self-correcting.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 18:51:47 +01:00
Fade78
b04092ce0f Add audit results and test badges to README
- Add test (1060 passed) and audit (★★★★☆) badges
- Add "Testing & Audits" section with audit summary table
- Link to full audit reports and test execution report
- Update .gitignore to prevent test data in root
- Add new audit reports (Alibaba Qwen3, OpenAI GPT-OSS)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:57:24 +01:00
Fade78
d6ba6cdd70 Reorder test report columns for better GitHub visibility
Column order: # | Status | Description | Command | Expected
Status () is now visible immediately after test number.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:57:24 +01:00
Fade78
c7b51bc5d6 Remove obsolete v1.0.3 audit directory
Audit reports moved to docs/audits/fileshed/reports/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:57:24 +01:00
Fade78
517e17650c Add test execution report (1060 tests, all passed)
Comprehensive test coverage report in table format showing:
- Test number and description
- Command executed
- Expected result (success/error code)
- Pass/fail status

All 1060 functional tests passing on v1.0.3.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:57:24 +01:00
Fade78
bdc12bcf7a Sync SPEC.md with code and update README version
SPEC.md:
- Add Design Rationale section (translated from Dev.md)
- Remove printenv/envsubst from whitelist (security)
- Remove MISSING_GROUP error code (uses MISSING_PARAMETER)
- Add INVALID_PATH, PROTECTED_PATH, CSV_TOO_WIDE error codes
- Clarify FILE_OWNER_ONLY/FILE_READ_ONLY are internal values
- Improve monolithic file justification

README.md:
- Update version badge 1.0.2 → 1.0.3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:57:24 +01:00
Fade78
7e7821e4c8 Add external security audit reports v1.0.3
- OpenAI ChatGPT 5.2 Instant: 4.6/5 rating
- Anthropic Claude Opus 4.5 Thinking: 3.5/5 rating

Both audits validate the security architecture with minor recommendations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:57:24 +01:00
Fade78
78f81e3c11 Delete .git 2026-01-30 10:57:24 +01:00
Fade78
1fed969d1c Security fixes from multi-axis audit
- Fix ZIP cross-zone extraction: validate dest_path with _resolve_chroot_path
- Fix filename collision: generate unique names with UUID for unknown files
- Fix shed_import: add __user__ None check before _get_user_root
- Fix mutable default arguments: replace = {} with = None
- Fix lock leak: add editzone_path existence check
- Remove chroot path exposure from error messages
- Add _release_lock() centralized function
- Add conv_id validation against path traversal characters
- Update SPEC.md: add ARGUMENT_REQUIRED, sum, uuencode, uudecode
- Remove unused COMMAND_NOT_ALLOWED error code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:57:24 +01:00
Fade78
0e75399847 Update SPEC.md error codes to match actual implementation
- Fix EXEC_TIMEOUT → TIMEOUT (actual code)
- Remove NETWORK_FORBIDDEN, LINK_NOT_FOUND, LINK_ACCESS_DENIED
  (uses COMMAND_FORBIDDEN, FILE_NOT_FOUND, ACCESS_DENIED instead)
- Add missing error codes: PATH_STARTS_WITH_ZONE, ZIP_BOMB,
  MISSING_GROUP, NO_USER_ID, NOT_A_FILESHED_LINK
- Add Open WebUI bridge error codes: OPENWEBUI_API_UNAVAILABLE,
  OPENWEBUI_INSERT_ERROR, OPENWEBUI_GET_ERROR, OPENWEBUI_DELETE_ERROR
- Clarify descriptions for COMMAND_FORBIDDEN and ARGUMENT_FORBIDDEN

https://claude.ai/code/session_01THb4YA4SqYG52LVwjwb5Uo
2026-01-30 10:57:24 +01:00
Fade78
1c40d972d2 Multi-axis audit fixes: security, code quality, API consistency
Security fixes:
- Add explicit symlink detection in _resolve_chroot_path
- Fix TOCTOU race conditions in _patch_text_impl and _patch_bytes_impl
- Sanitize SQLite error messages to prevent information leakage
- Add finally:conn.close() to prevent SQLite connection leaks
- Add readonly check for output_csv in shed_sqlite

Code quality:
- Replace bare except with specific exceptions (OSError, UnicodeDecodeError, etc.)
- Translate French comments to English in shed_import
- Refactor shed_sqlite to use centralized _resolve_zone()

API improvements:
- Change safe=False to safe=True by default in patch_text/patch_bytes
- Change message='' to message=None in zone movement functions

Documentation:
- Add comprehensive error codes reference table to SPEC.md

https://claude.ai/code/session_01THb4YA4SqYG52LVwjwb5Uo
2026-01-30 10:57:24 +01:00
Claude
6cc1382ecb
Update documentation: zones scope and missing valves
README:
- Add zone scope table (per conversation/user/group)
- Add versioning info (manual vs automatic)
- Add missing valves: exec_memory_limit_mb, exec_cpu_limit_seconds, sqlite_readonly

SPEC:
- Add same 3 missing valves
- Reorder valves for consistency with README

https://claude.ai/code/session_01DLaRR2nnTryPWd2p7MyUtf
2026-01-29 01:02:22 +00:00
Fade
57d1ffcc8d
Add initial specification for Fileshed Tool 2026-01-28 02:01:25 +01:00