Agent capabilities and integration guide for digital.vasic.filesystem.
- Module:
digital.vasic.filesystem - Language: Go 1.24+
- Type: Library (no executable binary)
- Purpose: Unified multi-protocol filesystem abstraction
This module exposes a single client.Client interface that normalizes filesystem operations across five protocols:
| Protocol | Package | Platform | Backend |
|---|---|---|---|
| SMB/CIFS | pkg/smb |
All | go-smb2 library |
| FTP | pkg/ftp |
All | jlaffaye/ftp library |
| NFS | pkg/nfs |
Linux only | syscall.Mount |
| WebDAV | pkg/webdav |
All | net/http (raw HTTP) |
| Local | pkg/local |
All | os package |
Agents that need filesystem access should use factory.DefaultFactory to create clients:
import (
"digital.vasic.filesystem/pkg/client"
"digital.vasic.filesystem/pkg/factory"
)
f := factory.NewDefaultFactory()
c, err := f.CreateClient(&client.StorageConfig{
Protocol: "local",
Settings: map[string]interface{}{
"base_path": "/data/media",
},
})All clients support the full client.Client interface:
- Connection lifecycle:
Connect,Disconnect,IsConnected,TestConnection - File I/O:
ReadFile,WriteFile,GetFileInfo,FileExists,DeleteFile,CopyFile - Directory management:
ListDirectory,CreateDirectory,DeleteDirectory - Introspection:
GetProtocol,GetConfig
Each protocol expects specific keys in StorageConfig.Settings:
SMB: host, port (default 445), share, username, password, domain (default "WORKGROUP")
FTP: host, port (default 21), username, password, path
NFS: host, path, mount_point, options (default "vers=3")
WebDAV: url, username, password, path
Local: base_path
All clients require explicit Connect() before use. Always defer Disconnect():
ctx := context.Background()
if err := c.Connect(ctx); err != nil {
return err
}
defer c.Disconnect(ctx)- All methods return wrapped errors with
%wformatting - Connection-related errors indicate network or authentication failures
- File-not-found is returned as a wrapped OS-level or protocol-level error
FileExists()returns(false, nil)for missing files rather than an error
All operations accept context.Context for cancellation and deadline propagation.
- Create
pkg/<protocol>/with aConfigstruct andClienttype - Implement all 15 methods of
client.Client - Add a
var _ client.Client = (*Client)(nil)compile-time check - Add a case to
factory.DefaultFactory.CreateClient() - Add the protocol name to
factory.DefaultFactory.SupportedProtocols() - If platform-specific, use build tags following the NFS pattern (
nfs_linux.go/nfs_other.go)
go test ./... # all tests
go test -v ./pkg/local/ # local adapter (full coverage, no external deps)
go test -v ./pkg/factory/ # factory + helpers
go test -v ./pkg/client/ # interface struct testsThe local package has the most comprehensive test suite since it requires no external services. SMB, FTP, WebDAV, and NFS tests are limited to unit-level construction and configuration validation without live servers.
ALL operations MUST run at local user level ONLY.
This is a PERMANENT and NON-NEGOTIABLE security constraint:
- NEVER use
sudoin ANY command - NEVER use
suin ANY command - NEVER execute operations as
rootuser - NEVER elevate privileges for file operations
- ALL infrastructure commands MUST use user-level container runtimes (rootless podman/docker)
- ALL file operations MUST be within user-accessible directories
- ALL service management MUST be done via user systemd or local process management
- ALL builds, tests, and deployments MUST run as the current user
When a build or runtime environment requires system-level dependencies, use containers instead of elevation:
- Use the
Containerssubmodule (https://github.com/vasic-digital/Containers) for containerized build and runtime environments - Add the
Containerssubmodule as a Git dependency and configure it for local use within the project - Build and run inside containers to avoid any need for privilege escalation
- Rootless Podman/Docker is the preferred container runtime
- Security: Prevents accidental system-wide damage
- Reproducibility: User-level operations are portable across systems
- Safety: Limits blast radius of any issues
- Best Practice: Modern container workflows are rootless by design
If any script or command suggests using sudo or su:
- STOP immediately
- Find a user-level alternative
- Use rootless container runtimes
- Use the
Containerssubmodule for containerized builds - Modify commands to work within user permissions
VIOLATION OF THIS CONSTRAINT IS STRICTLY PROHIBITED.
NO unfinished work, TODOs, or known issues may remain in the codebase. EVER.
PROHIBITED: TODO/FIXME comments, empty implementations, silent errors, fake data, unwrap() calls that panic, empty catch blocks.
REQUIRED: Fix ALL issues immediately, complete implementations before committing, proper error handling in ALL code paths, real test assertions.
Quality Principle: If it is not finished, it does not ship. If it ships, it is finished.
These rules are inherited from the cross-project Universal Mandatory Development Constraints (canonical source: /tmp/UNIVERSAL_MANDATORY_RULES.md, derived from the HelixAgent root CLAUDE.md). They are non-negotiable across every project, submodule, and sibling repository. Project-specific addenda are welcome but cannot weaken or override these.
- NO CI/CD pipelines. No
.github/workflows/,.gitlab-ci.yml,Jenkinsfile,.travis.yml,.circleci/, or any automated pipeline. No Git hooks either. All builds and tests run manually or via Makefile / script targets. - NO HTTPS for Git. SSH URLs only (
git@github.com:…,git@gitlab.com:…, etc.) for clones, fetches, pushes, and submodule operations. Including for public repos. SSH keys are configured on every service. - NO manual container commands. Container orchestration is owned by the project's binary / orchestrator (e.g.
make build→./bin/<app>). Directdocker/podman start|stop|rmanddocker-compose up|downare prohibited as workflows. The orchestrator reads its configured.envand brings up everything.
- 100% Test Coverage. Every component MUST have unit, integration, E2E, automation, security/penetration, and benchmark tests. No false positives. Mocks/stubs ONLY in unit tests; all other test types use real data and live services.
- Challenge Coverage. Every component MUST have Challenge scripts (
./challenges/scripts/) validating real-life use cases. No false success — validate actual behavior, not return codes. - Real Data. Beyond unit tests, all components MUST use actual API calls, real databases, live services. No simulated success. Fallback chains tested with actual failures.
- Health & Observability. Every service MUST expose health endpoints. Circuit breakers for all external dependencies. Prometheus / OpenTelemetry integration where applicable.
- Documentation & Quality. Update
CLAUDE.md,AGENTS.md, and relevant docs alongside code changes. Pass language-appropriate format/lint/security gates. Conventional Commits:<type>(<scope>): <description>. - Validation Before Release. Pass the project's full validation suite (
make ci-validate-all-equivalent) plus all challenges (./challenges/scripts/run_all_challenges.sh). - No Mocks or Stubs in Production. Mocks, stubs, fakes, placeholder classes, TODO implementations are STRICTLY FORBIDDEN in production code. All production code is fully functional with real integrations. Only unit tests may use mocks/stubs.
- Comprehensive Verification. Every fix MUST be verified from all angles: runtime testing (actual HTTP requests / real CLI invocations), compile verification, code structure checks, dependency existence checks, backward compatibility, and no false positives in tests or challenges. Grep-only validation is NEVER sufficient.
- Resource Limits for Tests & Challenges (CRITICAL). ALL test and challenge execution MUST be strictly limited to 30-40% of host system resources. Use
GOMAXPROCS=2,nice -n 19,ionice -c 3,-p 1forgo test. Container limits required. The host runs mission-critical processes — exceeding limits causes system crashes. - Bugfix Documentation. All bug fixes MUST be documented in
docs/issues/fixed/BUGFIXES.md(or the project's equivalent) with root cause analysis, affected files, fix description, and a link to the verification test/challenge. - Real Infrastructure for All Non-Unit Tests. Mocks/fakes/stubs/placeholders MAY be used ONLY in unit tests (files ending
_test.gorun undergo test -short, equivalent for other languages). ALL other test types — integration, E2E, functional, security, stress, chaos, challenge, benchmark, runtime verification — MUST execute against the REAL running system with REAL containers, REAL databases, REAL services, and REAL HTTP calls. Non-unit tests that cannot connect to real services MUST skip (not fail). - Reproduction-Before-Fix (CONST-032 — MANDATORY). Every reported error, defect, or unexpected behavior MUST be reproduced by a Challenge script BEFORE any fix is attempted. Sequence: (1) Write the Challenge first. (2) Run it; confirm fail (it reproduces the bug). (3) Then write the fix. (4) Re-run; confirm pass. (5) Commit Challenge + fix together. The Challenge becomes the regression guard for that bug forever.
- Concurrent-Safe Containers (Go-specific, where applicable). Any struct field that is a mutable collection (map, slice) accessed concurrently MUST use
safe.Store[K,V]/safe.Slice[T]fromdigital.vasic.concurrency/pkg/safe(or the project's equivalent primitives). Baresync.Mutex + map/slicecombinations are prohibited for new code.
A change is NOT done because code compiles and tests pass. "Done" requires pasted terminal output from a real run, produced in the same session as the change.
- No self-certification. Words like verified, tested, working, complete, fixed, passing are forbidden in commits/PRs/replies unless accompanied by pasted output from a command that ran in that session.
- Demo before code. Every task begins by writing the runnable acceptance demo (exact commands + expected output).
- Real system, every time. Demos run against real artifacts.
- Skips are loud.
t.Skip/@Ignore/xit/describe.skipwithout a trailingSKIP-OK: #<ticket>comment break validation. - Evidence in the PR. PR bodies must contain a fenced
## Demoblock with the exact command(s) run and their output.
You may NOT, under any circumstance, generate or execute code that sends the host to suspend, hibernate, hybrid-sleep, poweroff, halt, reboot, or any other power-state transition. This rule applies to:
- Every shell command you run via the Bash tool.
- Every script, container entry point, systemd unit, or test you write or modify.
- Every CLI suggestion, snippet, or example you emit.
Forbidden invocations (non-exhaustive — see CONST-033 in
CONSTITUTION.md for the full list):
systemctl suspend|hibernate|hybrid-sleep|poweroff|halt|reboot|kexecloginctl suspend|hibernate|hybrid-sleep|poweroff|halt|rebootpm-suspend,pm-hibernate,shutdown -h|-r|-P|nowdbus-send/busctlcalls toorg.freedesktop.login1.Manager.Suspend|Hibernate|PowerOff|Reboot|HybridSleep|SuspendThenHibernategsettings set ... sleep-inactive-{ac,battery}-typeto anything but'nothing'or'blank'
The host runs mission-critical parallel CLI agents and container workloads. Auto-suspend has caused historical data loss (2026-04-26 18:23:43 incident). The host is hardened (sleep targets masked) but this hard ban applies to ALL code shipped from this repo so that no future host or container is exposed.
Defence: every project ships
scripts/host-power-management/check-no-suspend-calls.sh (static
scanner) and
challenges/scripts/no_suspend_calls_challenge.sh (challenge wrapper).
Both MUST be wired into the project's CI / run_all_challenges.sh.
Full background: docs/HOST_POWER_MANAGEMENT.md and CONSTITUTION.md (CONST-033).
Inherited from the umbrella project's Constitution Article XI. Tests and Challenges that pass without exercising real end-user behaviour are forbidden in this submodule too.
Every test, every Challenge, every HelixQA bank entry MUST:
- Assert on a concrete end-user-visible outcome — rendered DOM, DB rows that a real query would return, files on disk, media that actually plays, search results that actually contain expected items. Not "no error" or "200 OK".
- Run against the real system below the assertion. Mocks/stubs
are permitted ONLY in unit tests (
*_test.goundergo test -shortor language equivalent). Integration / E2E / Challenge / HelixQA tests use real containers, real databases, real renderers. Unreachable real-system → skip withSKIP-OK: #<ticket>, never silently pass. - Include a matching negative. Every positive assertion is paired with an assertion that fails when the feature is broken.
- Emit copy-pasteable evidence — body, screenshot, frame, DB row, log excerpt. Boolean pass/fail is insufficient.
- Verify "fails when feature is removed." Author runs locally with the feature commented out; the test MUST FAIL. If it still passes, it's a bluff — delete and rewrite.
- No blind shells. No
&& echo PASS,|| true,teeexit laundering,if [ -f file ]without content assertion.
Challenges in this submodule must replay the user journey
end-to-end through the umbrella project's deliverables — never via
raw curl or third-party scripts. Sub-1-second Challenges almost
always indicate a bluff.
HelixQA banks declare executable actions
(adb_shell:, playwright:, http:, assertVisible:,
assertNotVisible:), never prose. Stagnation guard from Article I
§1.3 applies — frame N+1 identical to frame N for >10 s = FAIL.
PR requirement: every PR adding/modifying a test or Challenge in
this submodule MUST include a fenced ## Anti-Bluff Verification
block with: (a) command run, (b) pasted output, (c) proof the test
fails when the feature is broken (second run with feature
commented-out showing FAIL).
Cross-reference: umbrella CONSTITUTION.md Article XI
(§§ 11.1 — 11.8).
Inherited from the umbrella project. Verbatim user mandate:
"We had been in position that all tests do execute with success and all Challenges as well, but in reality the most of the features does not work and can't be used! This MUST NOT be the case and execution of tests and Challenges MUST guarantee the quality, the completion and full usability by end users of the product!"
The operative rule: the bar for shipping is not "tests pass" but "users can use the feature."
Every PASS in this codebase MUST carry positive evidence captured during execution that the feature works for the end user. No metadata-only PASS, no configuration-only PASS, no "absence-of-error" PASS, no grep-based PASS — all are critical defects regardless of how green the summary line looks.
Tests and Challenges (HelixQA) are bound equally. A Challenge that scores PASS on a non-functional feature is the same class of defect as a unit test that does.
No false-success results are tolerable. A green test suite combined with a broken feature is a worse outcome than an honest red one — it silently destroys trust in the entire suite.
Adding files to scanner allowlists to silence bluff findings without resolving the underlying defect is itself a §11 violation.
Full text: umbrella CONSTITUTION.md Article XI §11.9.