Skip to content

v1.36.0

Latest

Choose a tag to compare

@github-actions github-actions released this 18 Jun 07:12
Immutable release. Only release title and notes can be modified.

Added — confidence write-back from grounding reconciliation (#364, Phase 2 of #245)

The Phase-1 mk grounding report (read-only, #245) gains its destructive companion: mk grounding --apply writes a reconciled confidence back onto the actionable review/promote atoms. Gated on human_edit events (#247) — without that signal a blind write-back could clobber a confidence a human deliberately set. MINOR (new flags + exported engine).

  • Engine src/reconcile.ts (reconcileGrounding, reconciledConfidence): reuses computeGrounding/classifyQuadrant (no re-derived scoring). The reconciled value is an asymmetric convex pull of the prior toward the grounding score — reconciled = clamp(prior + α·(grounding − prior), 0, 1) — with α_neg = 0.08 > α_pos = 0.03 (SmartVector, arXiv 2604.20598) so disconfirmation (review: pull down) moves faster than confirmation (promote: pull up). The small step means repeated passes converge an atom toward its grounded value and stop once it crosses the quadrant threshold, rather than snapping onto the diagonal.
  • Provenance-aware skip: atoms carrying a human_edit event are skipped (human-asserted confidence) unless --override — this is the dependency on #247. Each write emits an atom_reconciled audit event (added to EVENT_ACTIONS + MUTATION_ACTIONS; carries the post-write snapshot, so replay reconstructs it and compaction keeps the latest). --dry-run previews; only review/promote atoms that pass the actionability guards and a minDelta floor (0.005) are written.
  • CLI (mk grounding --apply [--dry-run] [--override] [--agent-id] [--session-id]): --apply --json emits { scanned, candidates, applied, skipped_human_edit, skipped_below_min_delta, dry_run, changes[] } (distinct from the advisory report shape). Plain mk grounding is unchanged — still read-only, no index.
  • Exports (src/index.ts): reconcileGrounding/reconciledConfidence + ReconcileOptions/ReconcileResult/ReconcileChange + DEFAULT_ALPHA_NEG/DEFAULT_ALPHA_POS/DEFAULT_MIN_DELTA.
  • Completes #245 step 4 (the deferred write-back half). +14 tests (test/reconcile.test.ts + mk grounding --apply CLI cases); contracts.md §2.1 + sdk-reference.md grounding section + public-api-surface snapshot updated.

Added — human_edit events: close the dark-signal gap in provenance tracking (#247)

human_edit had been in EVENT_ACTIONS since v1 but was never emitted — direct filesystem edits (via $EDITOR, the Edit tool, or any non-mk path) bypassed the event system entirely, leaving the strongest correction signal in the store (a human directly validating or correcting an atom) invisible to the log. This wires both paths. MINOR (new public CLI command + flag + exported engine functions).

  • Forward path — mk edit <atom-id> (src/edit.ts, engine editAtom + CLI src/cli/edit.ts): opens the atom in $EDITOR, hashes the file before/after, and on change re-serializes through the canonical writer (so the on-disk bytes match the recorded snapshot) and emits a provenanced human_edit event carrying a diff summary (hash_before/hash_after, lines_added/lines_removed) in meta. No-op (no event) when saved unchanged; refuses encrypted (SECRET) atoms (editing ciphertext is meaningless). Injectable editor runner (EditorRunner) for testing. --dry-run/--json like mk execute.
  • Backward path — mk reflect --backfill-human-edits (src/provenance.ts, detectUnprovenancedWrites + backfillHumanEdits): detects writes that already happened off-band, labelled by confidence — content-diff (high: current serialized form, normalized through the current serializer to cancel format drift, differs from the snapshot in the last recorded mutation event; skipped for SECRET, whose snapshots are encrypted) and timestamp-heuristic (low: updated_at is newer than the last mutation event). Bulk mk doctor --fix migration passes cluster on a single same-second updated_at — that signature (≥3 candidates) is detected and excluded from backfill. Synthetic events are tagged meta.synthetic = true + their detection confidence. Opt-in (off by default in plain mk reflect) because content-diff also surfaces legitimate-but-eventless mk writes (relate/relink/enrich-relations); emission must be deliberate. ReflectResult gains optional unprovenanced_writes / human_edits_backfilled (present only with the flag, so the default result shape is unchanged).
  • human_edit added to MUTATION_ACTIONS (src/schema.ts) — it carries a full post-edit snapshot, so replay reconstructs the edited state and compaction keeps the latest per atom_ref. This is also what makes the backward detector idempotent: an emitted human_edit becomes the atom's latest snapshot baseline, so a second pass re-detects nothing.
  • Exports (src/index.ts): editAtom + EditOptions/EditResult/EditorRunner; detectUnprovenancedWrites/backfillHumanEdits + UnprovenancedWrite/DetectionConfidence/BackfillOptions/BackfillResult.
  • Unblocks the grounding reconciliation write-back (#364 / #245-246), which weights human corrections 2.67× over silent accepts and was operating without the disconfirmatory signal.
  • +17 tests (test/edit.test.ts, test/provenance.test.ts, test/edit-cli.test.ts); schema-v2/public-api-surface snapshots updated.

Changed — releases now publish CHANGELOG notes + an Announcements discussion

release.yml's main-package job now derives its GitHub-release notes from the curated CHANGELOG.md ## [X.Y.Z] section (via a new shared scripts/changelog-section.sh) instead of PR auto-notes, and posts a linked announcement in the public repo's Discussions Announcements category (gh release create --notes-file … --discussion-category "Announcements"; needs the new discussions: write workflow permission). scripts/sync-to-public.sh was migrated onto the same extractor so the CHANGELOG-section logic lives in exactly one place.

  • scripts/changelog-section.sh (new) — extract one version's CHANGELOG section; --body-only omits the heading. +9 tests (test/changelog-section.test.ts).
  • .github/workflows/release.yml — release notes from CHANGELOG; Announcements discussion; discussions: write.
  • scripts/sync-to-public.sh — reuse the shared extractor (sibling-relative resolution via SCRIPT_DIR).

CI / release-infra only — no version bump.

Fixed — Dependabot auto-merge workflow could not read status checks

The .github/workflows/dependabot-auto-merge.yml poll loop queries the PR's statusCheckRollup, which GitHub resolves through commit.statusCheckRollup. Reading that nested rollup needs checks: read and statuses: read, but the workflow's permissions: block granted only contents: write + pull-requests: write. Under the Dependabot-context GITHUB_TOKEN (undeclared permissions default to none), the GraphQL drill-down was denied with Resource not accessible by integration, so the job failed on its first poll and every Dependabot PR fell back to manual merge (e.g. #239).

  • .github/workflows/dependabot-auto-merge.yml — adds checks: read and statuses: read to the workflow permissions: block. No run: step or trigger change.

No library code, tests, or build outputs change — CI-infrastructure-only fix, no version bump.