CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 16s
CI & Build / TypeScript typecheck (push) Successful in 36s
CI & Build / Python tests (push) Failing after 1m48s
CI & Build / integration (push) Successful in 2m26s
CI & Build / Build & push image (push) Skipped
A rule is in force at a moment of a session when it was delivered there. Each (session, rule, place) now carries at most one verdict (rule_adherence, migration 0134): followed, departed, broken or not applicable, with where it came from: - an enforce rule refusing the act: followed, recorded by the moment arm, and never replaced; - the session's own rule_outcome (applied, departed) and rule_misfired calls, which the plugin's outcome hook now also posts with the session id (/api/plugin/rule-verdict) onto the delivery being answered; - a transcript review: adherence_to_judge lists what has no verdict yet, by session, and judge_adherence records verdicts with their evidence. rule_adherence (MCP) and /api/retrieval/adherence give the readout: sessions in force, opened and each verdict per rule and per place. Settings > Moments shows it in a "Were they followed" panel, beside each moment's delivered and opened counts, and per rule inside each moment. Verdicts are pruned with their deliveries and left out of backups like them. Plugin 2026.11.23.2227. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
2.4 KiB
Vue
53 lines
2.4 KiB
Vue
<script setup lang="ts">
|
|
import type { AdherenceCounts, MomentRuleUsage } from "@/api/moments";
|
|
|
|
/**
|
|
* Which rules a moment delivered, whether an agent went on to read each, and
|
|
* — where a verdict exists — whether it was followed there. The moment's own
|
|
* counts cannot say this once two rules are mounted there. Closed by default:
|
|
* the counts in the row above are what most visits want.
|
|
*/
|
|
withDefaults(defineProps<{
|
|
rules: MomentRuleUsage[];
|
|
/** This moment's adherence per rule id, from the adherence readout. */
|
|
adherence?: Record<number, AdherenceCounts>;
|
|
}>(), { adherence: () => ({}) });
|
|
|
|
function verdicts(c: AdherenceCounts | undefined): string {
|
|
if (!c) return "";
|
|
const parts = [`followed ${c.followed} of ${c.in_force}`];
|
|
if (c.broken) parts.push(`broken ${c.broken}`);
|
|
if (c.departed) parts.push(`departed ${c.departed}`);
|
|
if (c.not_applicable) parts.push(`not applicable ${c.not_applicable}`);
|
|
return parts.join(" · ");
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<details v-if="rules.length" class="moment-rules">
|
|
<summary>Rules delivered here</summary>
|
|
<ul class="delivered-list">
|
|
<li v-for="r in rules" :key="r.rule_id" class="delivered-row">
|
|
<span class="delivered-title">{{ r.title ?? `Rule ${r.rule_id} (deleted)` }}</span>
|
|
<span class="delivered-count">delivered {{ r.delivered }}</span>
|
|
<span :class="r.opened ? 'delivered-opened' : 'delivered-unopened'">
|
|
{{ r.opened ? "opened" : "not opened" }}
|
|
</span>
|
|
<span v-if="adherence[r.rule_id]" class="delivered-count">{{ verdicts(adherence[r.rule_id]) }}</span>
|
|
</li>
|
|
</ul>
|
|
</details>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.moment-rules { margin-top: var(--fs-space-2); font-size: var(--fs-size-tiny); }
|
|
.moment-rules summary { cursor: pointer; color: var(--fs-text-tertiary); }
|
|
.delivered-list { list-style: none; margin: var(--fs-space-1) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--fs-space-1); }
|
|
.delivered-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--fs-space-2); font-variant-numeric: tabular-nums; }
|
|
.delivered-title { color: var(--fs-text-primary); font-size: var(--fs-size-body-sm); }
|
|
.delivered-count { color: var(--fs-text-secondary); }
|
|
.delivered-opened { color: var(--fs-text-secondary); }
|
|
/* Not read is a fact about this window, not a fault: quiet, like "nothing mounted". */
|
|
.delivered-unopened { color: var(--fs-text-tertiary); font-style: italic; }
|
|
</style>
|