Skip to content

feat: add archive diagnostics - #113

Merged
steipete merged 3 commits into
mainfrom
codex/archive-diagnostics
Jul 1, 2026
Merged

feat: add archive diagnostics#113
steipete merged 3 commits into
mainfrom
codex/archive-diagnostics

Conversation

@steipete

@steipete steipete commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add discrawl diagnostics human and JSON output for database/WAL paths, sizes, SQLite journal/schema/integrity state, and archive freshness
  • report authoritative Discrawl writer-lock state and safe owner metadata while treating leftover metadata as stale
  • keep raw SQLite health independent from Discrawl schema compatibility, and keep missing-archive inspection non-mutating

Verification

  • GOWORK=off go test -count=1 ./...
  • go vet ./...
  • Windows cross-compile: GOOS=windows GOARCH=amd64 go test -c ./internal/cli
  • node scripts/build-docs-site.mjs
  • source-blind behavior contract against the exact built binary on a disposable synthetic archive: valid, active-writer, stale-metadata, schema-mismatch, and missing-archive paths passed
  • autoreview clean after fixing lock-probe ambiguity and schema-coupled integrity checks

Closes #102.

@steipete
steipete merged commit 1fbb78f into main Jul 1, 2026
10 checks passed
@steipete
steipete deleted the codex/archive-diagnostics branch July 1, 2026 07:35

@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: 17691890bc

ℹ️ 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".

lockPath := filepath.Join(dir, ".discrawl-sync.lock")
require.NoError(t, os.WriteFile(lockPath, []byte("locked"), 0o600))
writeSyncLockMetadata(t, lockPath, "wiretap", os.Getpid())
require.NoError(t, os.Chmod(lockPath, 0))

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 Make the lock-probe failure test work as root

When the suite runs as root or with CAP_DAC_OVERRIDE (common in Docker-based CI), chmod 0 does not make os.Open fail, so syncLockState can acquire/release the lock and the command reports stale_metadata instead of unknown. That makes this new Unix test fail in those environments; use a root-independent failure setup or skip this case when running as root.

Useful? React with 👍 / 👎.

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.

Add process and SQLite lock diagnostics

1 participant