Document audit-log retention/persistence policy in SPEC.md and pin it in AuditLog #7
Labels
No labels
blocked:needs-attention
blocked:needs-decision
blocked:needs-decompose
blocked:needs-design
blocked:needs-triage
blocked:unclassified
bug
documentation
enhancement
gsd-spec
in-progress
needs-decompose
priority:high
priority:low
priority:medium
quickfix
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/veilwalkers#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
docs/ARCHITECTURE.mddocuments the action-layer chain ends withAuditLog.log_action(...)for every admin action (world edits, scripts compiled, points granted, players kicked). The architecture treats audit as load-bearing for the security model, but nothing pins:Without these pinned, an admin kick or a malicious script deployment leaves no auditable trail across restarts, which defeats the purpose.
What to do
AuditLog.gd(currently unknown shape) to determine current persistence.## Audit logsection indocs/ARCHITECTURE.md:user://audit.logis the obvious default — confirm);AuditLog(MAX_AGE_DAYS = 30,MAX_FILE_BYTES = 10_485_760) so the docs and code can't drift.tests/test_audit_log.gdwrites an entry, asserts the file format, asserts rotation behavior.Acceptance
docs/ARCHITECTURE.mdhas the## Audit logsection.AuditLog.gdexposes the retention knobs as constants. The new test passes. Existing CI stays green.Labels
documentation,enhancementClosed via commit
f209c96on main.What landed:
scripts/sec/audit_log.gd— addedMAX_AGE_DAYS=30,MAX_AGE_SECONDS,MAX_FILE_BYTES=10_485_760,LOG_PATH='user://audit.log',ROTATED_PATH='user://audit.log.1'as pinned constants; NDJSON append-only persistence at_log_path; single-generation rotation when the active file hitsMAX_FILE_BYTES; in-memory pruning by BOTH count cap and age cap on everylog_action(); constructor-time rehydration of the in-memory ring from the most recentMAX_ENTRIESlines (skipping anything pastMAX_AGE_SECONDS) so audit history survives a server restart;timefield switched toTime.get_unix_time_from_system()(absolute unix seconds).docs/ARCHITECTURE.md— new## Audit logsection pinning storage path, retention policy, rotation behavior, and query interface in the same format operators read the constants in.tests/unit/test_audit_log.gd+.tscn— 26 checks: constants pinned at expected values, NDJSON format one-line-per-entry,MAX_ENTRIESring cap,MAX_AGE_SECONDSage drop, rotation atMAX_FILE_BYTES, default-path constructor, restart-survival rehydration, EventBus-absent graceful fallback.Gates:
verify.shPASS,lint.shPASS, all 6 unit suites + e2e + sandbox = 327 checks PASS.Docs and code are mirrored: change a constant, change the same value in the ARCHITECTURE.md
## Audit logtable in the same commit.Closed via commit
f209c96on main.What landed:
scripts/sec/audit_log.gd— addedMAX_AGE_DAYS=30,MAX_AGE_SECONDS,MAX_FILE_BYTES=10_485_760,LOG_PATH='user://audit.log',ROTATED_PATH='user://audit.log.1'as pinned constants; NDJSON append-only persistence at_log_path; single-generation rotation when the active file hitsMAX_FILE_BYTES; in-memory pruning by BOTH count cap and age cap on everylog_action(); constructor-time rehydration of the in-memory ring from the most recentMAX_ENTRIESlines (skipping anything pastMAX_AGE_SECONDS) so audit history survives a server restart;timefield switched toTime.get_unix_time_from_system()(absolute unix seconds).docs/ARCHITECTURE.md— new## Audit logsection pinning storage path, retention policy, rotation behavior, and query interface in the same format operators read the constants in.tests/unit/test_audit_log.gd+.tscn— 26 checks: constants pinned at expected values, NDJSON format one-line-per-entry,MAX_ENTRIESring cap,MAX_AGE_SECONDSage drop, rotation atMAX_FILE_BYTES, default-path constructor, restart-survival rehydration, EventBus-absent graceful fallback.Gates:
verify.shPASS,lint.shPASS, all 6 unit suites + e2e + sandbox = 327 checks PASS.Docs and code are mirrored: change a constant, change the same value in the ARCHITECTURE.md
## Audit logtable in the same commit.