Skip to content

refactor: rename SPIFFE_DEMO prefix to DOCSCLAW and fix workspace path - #95

Merged
pavelanni merged 3 commits into
mainfrom
feature/rename-spiffe-and-fix-workspace
Jul 1, 2026
Merged

pavelanni merged 3 commits into
mainfrom
feature/rename-spiffe-and-fix-workspace

Conversation

@pavelanni

@pavelanni pavelanni commented Jul 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Breaking: Rename env var prefix SPIFFE_DEMO_* → DOCSCLAW_* in internal/config/config.go
  • Breaking: Rename config path /etc/spiffe-demo/ → /etc/docsclaw/ in internal/config/config.go
  • Breaking: Rename Prometheus metric namespace spiffe_demo → docsclaw (all 7 metrics) in internal/metrics/metrics.go
  • Rename logger env var SPIFFE_DEMO_LOG_FORMAT → DOCSCLAW_LOG_FORMAT in internal/logger/logger.go
  • Fix default workspace from /tmp/agent-workspace → /workspace (safe under readOnlyRootFilesystem: true)
  • Inject workspace path into system prompt so the LLM writes files to the correct location
  • Update deployment manifests: env var names, workspace ConfigMap value, and volume mount path

Migration notes

Anyone currently using SPIFFE_DEMO_* env vars must switch to DOCSCLAW_*. Prometheus dashboards referencing spiffe_demo_* metric names must be updated (no known external consumers).

Test plan

  • All tests pass (make test)
  • No new lint issues (make lint — 4 pre-existing issues only)
  • Grep confirms zero remaining SPIFFE_DEMO/spiffe-demo/spiffe_demo strings
  • Deploy to OpenShift and verify agent starts with DOCSCLAW_* env vars
  • Confirm Prometheus scrapes show docsclaw_* metric names
  • Confirm agent writes files to /workspace (not /tmp)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added new HR and finance agent configurations, including bundled prompts, tool constraints, and agent metadata.
  • Bug Fixes
    • Standardized agent workspace handling to use /workspace across demos, deployments, examples, and configuration snippets.
    • Improved server fallback behavior to create/use /workspace when no workspace is set.
    • Updated security runtime cache to write under /workspace for vulnerability tooling.
  • Documentation
    • Updated getting-started and config guide examples to reflect /workspace and current DocsClaw naming/port env vars.
  • Chores
    • Aligned logging, metrics namespace, and configuration defaults with the updated DocsClaw conventions.

Replace all SPIFFE_DEMO-era naming artifacts with the current project
identity, and fix the default workspace path to be container-safe.

Breaking changes:
- Env var prefix SPIFFE_DEMO_* → DOCSCLAW_* (e.g. DOCSCLAW_OTEL_ENABLED)
- Config path /etc/spiffe-demo/ → /etc/docsclaw/
- Prometheus metric namespace spiffe_demo → docsclaw (all 7 metrics)
- Logger env var SPIFFE_DEMO_LOG_FORMAT → DOCSCLAW_LOG_FORMAT

Workspace fixes:
- Default workspace /tmp/agent-workspace → /workspace (safe with
  readOnlyRootFilesystem: true in container hardening)
- System prompt now includes workspace path so the LLM writes files
  to the correct location instead of guessing /tmp
- Deployment manifests updated: volume mount at /workspace,
  agent-config.yaml workspace field updated to /workspace

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 06db2dc7-53bf-4396-8ecd-cb39992bb6c8

📥 Commits

Reviewing files that changed from the base of the PR and between 4fd6281 and c498eb9.

📒 Files selected for processing (1)
  • internal/cmd/serve.go

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting


📝 Walkthrough

Walkthrough

This PR updates workspace defaults and mounts from /tmp/agent-workspace to /workspace, renames DocsClaw configuration surfaces, and adds new finance, HR, and security agent ConfigMaps with updated workspace settings and manifests.

Changes

Workspace and naming migration

Layer / File(s) Summary
Core runtime settings
internal/cmd/serve.go, internal/config/config.go, internal/logger/logger.go, internal/metrics/metrics.go, internal/workspace/workspace.go
The fallback workspace becomes /workspace, Viper and logger aliases switch to DocsClaw names, metric namespaces change to docsclaw, and the workspace comment examples are updated.
Security image workspace
containers/Containerfile.security
The security image now creates /workspace and points Trivy and Grype cache directories there.
Deployment workspace mounts
deploy/*.yaml, demo/batch/*, docs/demo/*.yaml, examples/*, site/getting-started.html
Workspace mount paths and related service-port env var names are updated across deployment manifests and example configs.
Agent configs and docs
demo/batch/finance/finance-analyst-config.yaml, demo/batch/hr/hr-screener-config.yaml, demo/batch/security/security-analyst-config.yaml, README.md, docs/agent-config-guide.md, openspec/changes/.../tasks.md
New agent ConfigMaps are added, and workspace defaults in docs and task tracking are updated to /workspace.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related issues

Possibly related PRs

  • redhat-et/docsclaw#66: Introduced batch dashboard deployment wiring that this PR updates to use /workspace.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: renaming SPIFFE_DEMO to DOCSCLAW and switching the workspace path to /workspace.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/rename-spiffe-and-fix-workspace

Comment @coderabbitai help to get the list of available commands.

Address review feedback on PR #95: the initial commit renamed the
default workspace in serve.go and the two primary deploy manifests,
but left /tmp/agent-workspace in all other user-facing assets.

Changes:
- containers/Containerfile.security: create /workspace (same 65532:0
  owner, 775 mode); point TRIVY_CACHE_DIR and GRYPE_DB_CACHE_DIR
  to /workspace/.cache/* so scanner databases land on the writable
  emptyDir volume rather than the read-only image layer
- demo/batch/{finance,hr,security}: agent-config.yaml, deployment.yaml,
  deployment-template.yaml, and *-config.yaml batch run configs
- demo/batch/dashboard/k8s.go: volume mount path
- examples/{nps-explorer,skill-playground}: configmap + deployment
- docs/demo/{hr-analyst,skill-discovery-test,executive-assistant}.yaml
- README.md, docs/agent-config-guide.md (field reference default),
  site/getting-started.html
- testdata/research-agent/agent-config.yaml
- internal/workspace/workspace.go: update traversal-guard comment
  example from /tmp/agent to /workspace/agent

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@pavelanni
pavelanni marked this pull request as ready for review July 1, 2026 01:48

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
internal/cmd/serve.go (1)

260-268: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Workspace default and prompt injection look correct.

Default path, directory creation, and prompt injection are consistent with the new /workspace convention and the readOnlyRootFilesystem: true deployments (which mount an emptyDir at /workspace).

One minor note: "/workspace" is now a hardcoded literal here and duplicated across multiple YAML configs. Extracting it as a package-level constant (e.g., defaultWorkspace) would reduce drift risk if the path changes again.

🤖 Prompt for 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.

In `@internal/cmd/serve.go` around lines 260 - 268, The workspace default is
hardcoded as a literal in the serve startup logic, which can drift from the same
path used in deployment configs. Introduce a package-level constant such as
defaultWorkspace in serve.go and use it in the workspace fallback and prompt
text so the value is defined once and stays consistent across
agentCfg.Tools.Workspace handling and the systemPrompt message.
🤖 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.

Nitpick comments:
In `@internal/cmd/serve.go`:
- Around line 260-268: The workspace default is hardcoded as a literal in the
serve startup logic, which can drift from the same path used in deployment
configs. Introduce a package-level constant such as defaultWorkspace in serve.go
and use it in the workspace fallback and prompt text so the value is defined
once and stays consistent across agentCfg.Tools.Workspace handling and the
systemPrompt message.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: e2ae9ccb-fa1e-4222-8954-9d4820e569b9

📥 Commits

Reviewing files that changed from the base of the PR and between 6b6b80e and 4fd6281.

📒 Files selected for processing (31)
  • README.md
  • containers/Containerfile.security
  • demo/batch/dashboard/k8s.go
  • demo/batch/finance/agent-config.yaml
  • demo/batch/finance/deployment-template.yaml
  • demo/batch/finance/deployment.yaml
  • demo/batch/finance/finance-analyst-config.yaml
  • demo/batch/hr/agent-config.yaml
  • demo/batch/hr/deployment.yaml
  • demo/batch/hr/hr-screener-config.yaml
  • demo/batch/security/agent-config.yaml
  • demo/batch/security/deployment.yaml
  • demo/batch/security/security-analyst-config.yaml
  • deploy/agent-with-skills.yaml
  • deploy/standalone-agent.yaml
  • docs/agent-config-guide.md
  • docs/demo/executive-assistant.yaml
  • docs/demo/hr-analyst.yaml
  • docs/demo/skill-discovery-test.yaml
  • examples/nps-explorer/configmap.yaml
  • examples/nps-explorer/deployment.yaml
  • examples/skill-playground/configmap.yaml
  • examples/skill-playground/deployment.yaml
  • internal/cmd/serve.go
  • internal/config/config.go
  • internal/logger/logger.go
  • internal/metrics/metrics.go
  • internal/workspace/workspace.go
  • openspec/changes/rename-spiffe-and-fix-workspace/tasks.md
  • site/getting-started.html
  • testdata/research-agent/agent-config.yaml

Replace the /workspace literal with a package-level constant so the
fallback value and the system prompt injection are defined in one place
and cannot drift independently.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@pavelanni
pavelanni merged commit c4da67b into main Jul 1, 2026
4 checks passed
@pavelanni
pavelanni deleted the feature/rename-spiffe-and-fix-workspace branch July 1, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant