Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .changeset/replay-jsdoc-run-history.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
---
"@objectstack/spec": patch
---

fix(spec): `IJobService` JSDoc stops calling `sys_job_run` "the audit trail" — it's job run history (#9673)

`packages/spec/src/contracts/job-service.ts` called the storage `replay()` and
`JobRunOutcome.reason` write to "the execution audit trail" / "the audit
trail" in three spots. The binding #9633 ruling: `sys_job_run` is **job run
history**, not the audit trail — `sys_audit_log` is the audit surface, with
its own opt-in, writer and retention. Published `.d.ts` tooltip text pointing
readers at the wrong subsystem was exactly the conflation that ruling
rejected.

Wording only — `reason?`, `replay?()` and their runtime behavior are
unchanged. `replay`'s JSDoc also gains the caveat #9673 suggested: recording
anything durable depends on an adapter that persists run history at all
(e.g. `DbJobAdapter`'s `recordRuns` option), since #9633 made that
conditional where the prose previously read as unconditional.
9 changes: 6 additions & 3 deletions packages/spec/src/contracts/job-service.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,7 +56,7 @@ export interface JobSchedule {
* indistinguishable from a wake that actually woke something.
*
* `reason` is a short operator-facing note (`'STORE_UNAVAILABLE'`, `'0 rows
* matched'`) — free text for an audit surface, never a machine-dispatched code.
* matched'`) — free text for run history, never a machine-dispatched code.
*/
export interface JobRunOutcome {
/**
Expand All@@ -67,7 +67,7 @@ export interface JobRunOutcome {
* not a failure** (see {@link JobHandler}).
*/
outcome: 'completed' | 'degraded';
/** Why the run was degraded — short, human-readable, for the audit trail. */
/** Why the run was degraded — short, human-readable, for job run history. */
reason?: string;
}

Expand DownExpand Up@@ -190,7 +190,10 @@ export interface IJobService {
/**
* Replay the most recent execution of a job — useful from admin UI.
* Equivalent to `trigger(name)` but records that this run is a replay
* in the execution audit trail.
* in job run history (`sys_job_run`) — not the audit trail; that's
* `sys_audit_log`, with its own opt-in, writer and retention. Recording
* anything durable depends on an adapter that persists run history at all
* (e.g. `DbJobAdapter`'s `recordRuns` option).
*/
replay?(name: string, data?: unknown): Promise<void>;

Expand Down
Loading