instar 1.3.755 → 1.3.757
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/lint-model-registry-freshness.mjs +77 -11
- package/scripts/model-registry-freshness.manifest.json +34 -28
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.756.md +27 -0
- package/upgrades/1.3.757.md +29 -0
- package/upgrades/side-effects/doorway-model-registry-inc1.md +89 -0
- package/upgrades/side-effects/keyword-lint-enforce.md +113 -0
- package/dist/core/AutonomySkill.d.ts +0 -98
- package/dist/core/AutonomySkill.d.ts.map +0 -1
- package/dist/core/AutonomySkill.js +0 -497
- package/dist/core/AutonomySkill.js.map +0 -1
- package/dist/core/TopicClassifier.d.ts +0 -54
- package/dist/core/TopicClassifier.d.ts.map +0 -1
- package/dist/core/TopicClassifier.js +0 -144
- package/dist/core/TopicClassifier.js.map +0 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Side-Effects Review — Keyword-Intent Ratchet: flip to ENFORCE + resolve 3 latent offenders
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `keyword-lint-enforce`
|
|
4
|
+
**Date:** `2026-07-04`
|
|
5
|
+
**Author:** `Echo (instar-dev agent)`
|
|
6
|
+
**Second-pass reviewer:** `fork reviewer (see below)`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
Gives the "Intelligence Infers, Keywords Only Guard" ratchet (`tests/unit/keyword-intent-decision-ratchet.test.ts`) its enforcement teeth and clears the last three latent offenders. Two edits carry the weight: `ENFORCE = false → true` (the `<= BASELINE` guard is now a hard CI failure, not a warning) and `BASELINE = 4 → 1`. The three original latent offenders are resolved: `core/TopicClassifier.ts` and `core/AutonomySkill.ts` are **removed** as genuinely-dead code (verified zero runtime importers), and `core/AgentReadinessScorer.ts` is **allowlisted** as a legitimate task-nature survivor (it scores a task's coordination-vs-judgment ratio for an advisory endpoint, not message intent). Supporting edits: drop the `AutonomySkill` barrel export from `src/index.ts`, delete `tests/unit/AutonomySkill.test.ts`, surgically remove the `TopicClassifier` describe block + imports from `tests/e2e/discovery-round2-final.test.ts`, and drop the two deleted class names from the `under-the-hood.md` class list. Docs (`spec` + `eli16`) extended to record the flip. The only decision-point surface here is a CI-time lint ratchet; there is no runtime message-path behavior change.
|
|
11
|
+
|
|
12
|
+
## Decision-point inventory
|
|
13
|
+
|
|
14
|
+
- `keyword-intent-decision-ratchet` CI ratchet — **modify** — flips from report-mode (warn) to enforcing (fail CI on net-new offender); baseline lowered 4→1.
|
|
15
|
+
- `TopicClassifier.scoreKeywords` (runtime) — **remove** — dead-code keyword classifier, no runtime callers; deleted.
|
|
16
|
+
- `AutonomySkill.INTENT_PATTERNS` (runtime) — **remove** — unwired keyword intent recognizer; deleted.
|
|
17
|
+
- `AgentReadinessScorer.scoreText` (runtime) — **pass-through** — unchanged; only its ratchet classification moves (offender → allowlisted survivor).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 1. Over-block
|
|
22
|
+
|
|
23
|
+
**What legitimate inputs does this change reject that it shouldn't?**
|
|
24
|
+
|
|
25
|
+
The only "block" surface is CI. Over-block here = the ratchet failing a PR that is not actually a keyword-intent offender (a false positive). This is the risk the enforcement flip introduces. It is mitigated structurally: the detector is deliberately tuned to under-report (errs toward false negatives), the audit's cleared classes are explicitly allowlisted, and the change ran a full soak cycle in report mode (merged 2026-07-03, many PRs since) with zero false positives. Verified on this branch: the ratchet flags exactly one file (`topicProfileIngress`), matching `BASELINE = 1`. There is no runtime/message over-block surface — this never rejects a user message.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Under-block
|
|
30
|
+
|
|
31
|
+
**What failure modes does this still miss?**
|
|
32
|
+
|
|
33
|
+
The detector's two regex signatures can miss a subtly-shaped keyword-intent gate (e.g. a list assembled at runtime, or a message-var name outside the recognized set). This is the intended conservatism (a noisy ratchet gets disabled). A NEW offender added *inside* an allowlisted file is also masked — including, now, `AgentReadinessScorer.ts`: a future keyword-intent message gate added to that file would not be caught. This is the documented, accepted cost of every allowlist entry. The removal of the two dead modules strictly shrinks the under-block surface (two fewer places a keyword classifier could be silently re-wired).
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 3. Level-of-abstraction fit
|
|
38
|
+
|
|
39
|
+
**Is this at the right layer?**
|
|
40
|
+
|
|
41
|
+
Yes. The ratchet is a build-time lint (a low-cost structural guard), sibling to `no-silent-fallbacks`, enforcing a constitutional standard at the exact layer that standard is meant to bite — before merge, in CI, per-file. It is not a runtime authority over messages (that would be the wrong layer for a keyword-shaped detector). The flip to enforce is the planned graduated-rollout step the original spec's Rollout section already specified. The dead-code removals are at the correct layer too: deleting an unused module is the right resolution for a latent offender that nothing wires — converting it to LLM-with-context would be dead work on dead code.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 4. Signal vs authority compliance
|
|
46
|
+
|
|
47
|
+
**Required reference:** docs/signal-vs-authority.md
|
|
48
|
+
|
|
49
|
+
- [x] Yes — but the logic is appropriate for its layer: a CI-time ratchet whose "authority" is failing a build on a per-file structural count, with a human-authored allowlist + explicit baseline doing the precision work. It holds no runtime authority over any message.
|
|
50
|
+
|
|
51
|
+
The ratchet is a deterministic structural check, not a runtime gate over conversational content. Its "block" is a red CI check that a human (or the agent) resolves by converting the offender to LLM-with-context or justifying it as a survivor — exactly the graduated no-silent-fallbacks pattern. It never sits in the message path. Brittle-logic-with-runtime-block-authority (the anti-pattern this question guards) does not apply.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 5. Interactions
|
|
56
|
+
|
|
57
|
+
- **Shadowing:** none. The ratchet is a standalone vitest file; it does not run before/after another check in any pipeline. Removing the two modules cannot shadow anything — nothing imported them.
|
|
58
|
+
- **Double-fire:** none. Single test file, single assertion path.
|
|
59
|
+
- **Races:** none. No shared mutable state; the detector reads source files at test time.
|
|
60
|
+
- **Feedback loops:** none.
|
|
61
|
+
- **Test-file interaction:** `tests/e2e/discovery-round2-final.test.ts` imported `TopicClassifier`; its describe block was surgically removed and the remaining three blocks (which test `FeatureRegistry`, not `TopicClassifier`) verified green (12 tests pass). `tests/unit/AutonomySkill.test.ts` was the only consumer of `AutonomySkill` and was deleted with it.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 6. External surfaces
|
|
66
|
+
|
|
67
|
+
- Other agents / install base: no runtime change — this is a test + dead-code removal. Removing the `AutonomySkill` barrel export from `src/index.ts` is technically a public-API narrowing, but instar is consumed as a CLI/server, not as a library whose consumers import `AutonomySkill`; the audit itself classified it "exported, unwired". No known consumer.
|
|
68
|
+
- External systems (Telegram/Slack/GitHub/Cloudflare): none.
|
|
69
|
+
- Persistent state: none — no ledgers, DBs, or memory files touched.
|
|
70
|
+
- Timing/runtime: none.
|
|
71
|
+
- **Operator surface:** no operator-facing actions added or touched — not applicable.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 6b. Operator-surface quality
|
|
76
|
+
|
|
77
|
+
No operator surface — not applicable. This change touches only a test, two deleted `src/core` modules, a barrel export, and docs; no dashboard renderer, approval page, or grant/secret form.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 7. Multi-machine posture (Cross-Machine Coherence)
|
|
82
|
+
|
|
83
|
+
**Machine-local BY DESIGN** — with the reason: this is a build-time CI lint plus source-tree deletions. It has no runtime state, emits no user-facing notices, holds no durable state that could strand on topic transfer, and generates no URLs. The ratchet runs identically in every checkout because it reads the committed source tree; there is nothing to replicate or proxy. A multi-machine agent sees byte-identical behavior on every machine.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 8. Rollback cost
|
|
88
|
+
|
|
89
|
+
**Pure code + test change — revert and ship a patch.** No persistent state, no data migration, no agent-state repair, no user-visible regression during the rollback window. The narrow rollback lever for just the enforcement teeth is a one-line flip (`ENFORCE = true → false`) back to report mode. Restoring the two deleted modules, if ever genuinely wanted, is a `git revert` — their full source lives in history. `BASELINE` and `EXPECTED_OFFENDERS` are kept internally consistent, so a revert is mechanical.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Conclusion
|
|
94
|
+
|
|
95
|
+
The review produced no design changes. The change is proportionate: it flips a lint to enforcing after a clean soak (the planned rollout step) and resolves the three latent offenders the correct way per offender — delete the two verified-dead keyword classifiers, allowlist the one genuine task-nature survivor. The only genuine risk (a CI false positive from the enforcement flip) is mitigated by the soak, the conservatism-first detector, and the allowlist, and is confirmed absent on this branch (offenders == baseline == 1). tsc, lint, the ratchet suite, and the affected e2e all green. Clear to ship.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Second-pass review (if required)
|
|
100
|
+
|
|
101
|
+
**Reviewer:** independent reviewer subagent (Phase 5 — change touches a "guard"/"gate")
|
|
102
|
+
**Independent read of the artifact: concur**
|
|
103
|
+
|
|
104
|
+
Concur with the review. Independently verified: the diff matches the artifact (deletions of `AutonomySkill.ts`/`TopicClassifier.ts`/their tests, ratchet `ENFORCE false→true` + `BASELINE 4→1`, `EXPECTED_OFFENDERS == ['core/topicProfileIngress.ts']`, `AgentReadinessScorer` moved to ALLOWLIST); the two removed modules are truly dead (grep across `src/` → only a comment reference, zero runtime consumers); `AgentReadinessScorer` is genuinely wired at `src/server/routes.ts` for the `/agent-readiness` endpoint and scores task-nature (`COORDINATION_SIGNALS`/`JUDGMENT_SIGNALS` density → `coordinationRatio`), not message intent — the allowlist justification is accurate; `tsc --noEmit` exit 0; `vitest` 17 passed (ratchet in ENFORCE, baseline 1); the ratchet's internal guards remain coherent.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Evidence pointers
|
|
109
|
+
|
|
110
|
+
- `npx vitest run tests/unit/keyword-intent-decision-ratchet.test.ts tests/e2e/discovery-round2-final.test.ts` → 17 passed; ratchet prints `[KEYWORD-INTENT] 1 keyword-list intent decisions (baseline 1, mode=ENFORCE)`.
|
|
111
|
+
- `npx tsc --noEmit` → exit 0 (no lingering references to removed symbols).
|
|
112
|
+
- `npm run lint` → exit 0.
|
|
113
|
+
- Wiring verification: `grep` across `src/` for static imports, dynamic `import()`, `new X`, and function-name imports of `TopicClassifier`/`AutonomySkill`/`classifyForDiscovery` → zero runtime consumers.
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AutonomySkill — Conversational interface for autonomy management.
|
|
3
|
-
*
|
|
4
|
-
* Users interact with autonomy through natural language.
|
|
5
|
-
* This module translates between human intent and AutonomyProfileManager
|
|
6
|
-
* operations. The agent calls these functions; the user never types CLI commands.
|
|
7
|
-
*
|
|
8
|
-
* Functions:
|
|
9
|
-
* - getAutonomyStatus() → natural language summary of current state
|
|
10
|
-
* - setAutonomyProfile() → change profile with confirmation
|
|
11
|
-
* - getTrustDashboard() → detailed trust view with elevation opportunities
|
|
12
|
-
* - handleAutonomyRequest() → parse natural language and dispatch
|
|
13
|
-
* - notification templates → formatted strings for Telegram delivery
|
|
14
|
-
*
|
|
15
|
-
* Part of the Adaptive Autonomy System spec.
|
|
16
|
-
*/
|
|
17
|
-
import type { AutonomyProfileManager } from './AutonomyProfileManager.js';
|
|
18
|
-
import type { TrustElevationTracker, RubberStampSignal, ElevationOpportunity } from './TrustElevationTracker.js';
|
|
19
|
-
import type { TrustRecovery, RecoverySuggestion } from './TrustRecovery.js';
|
|
20
|
-
import type { AutonomyProfileLevel, ResolvedAutonomyState } from './types.js';
|
|
21
|
-
export interface AutonomySkillDeps {
|
|
22
|
-
autonomyManager: AutonomyProfileManager;
|
|
23
|
-
trustElevationTracker?: TrustElevationTracker | null;
|
|
24
|
-
trustRecovery?: TrustRecovery | null;
|
|
25
|
-
}
|
|
26
|
-
export interface AutonomyResponse {
|
|
27
|
-
/** Natural language text to show the user */
|
|
28
|
-
text: string;
|
|
29
|
-
/** What action was taken (for logging / agent context) */
|
|
30
|
-
action: 'status' | 'set-profile' | 'trust-dashboard' | 'suggest-elevation' | 'revert' | 'info';
|
|
31
|
-
/** Profile after the action (if changed) */
|
|
32
|
-
newProfile?: AutonomyProfileLevel;
|
|
33
|
-
/** The resolved state after the action */
|
|
34
|
-
resolved?: ResolvedAutonomyState;
|
|
35
|
-
}
|
|
36
|
-
export declare class AutonomySkill {
|
|
37
|
-
private deps;
|
|
38
|
-
constructor(deps: AutonomySkillDeps);
|
|
39
|
-
/**
|
|
40
|
-
* Parse a natural language message and dispatch to the appropriate action.
|
|
41
|
-
* This is the main entry point for conversational autonomy management.
|
|
42
|
-
*/
|
|
43
|
-
handleAutonomyRequest(userMessage: string): AutonomyResponse;
|
|
44
|
-
/**
|
|
45
|
-
* Get a natural language summary of the current autonomy state.
|
|
46
|
-
*/
|
|
47
|
-
getAutonomyStatus(): AutonomyResponse;
|
|
48
|
-
/**
|
|
49
|
-
* Set the autonomy profile and return a confirmation with what changed.
|
|
50
|
-
*/
|
|
51
|
-
setAutonomyProfile(profile: AutonomyProfileLevel): AutonomyResponse;
|
|
52
|
-
/**
|
|
53
|
-
* Get the trust dashboard — detailed trust view with per-service levels.
|
|
54
|
-
*/
|
|
55
|
-
getTrustDashboard(): AutonomyResponse;
|
|
56
|
-
/**
|
|
57
|
-
* Format a trust elevation suggestion for Telegram delivery.
|
|
58
|
-
*/
|
|
59
|
-
static formatElevationSuggestion(opportunity: ElevationOpportunity): string;
|
|
60
|
-
/**
|
|
61
|
-
* Format a rubber-stamp detection message for Telegram delivery.
|
|
62
|
-
*/
|
|
63
|
-
static formatRubberStampAlert(signal: RubberStampSignal): string;
|
|
64
|
-
/**
|
|
65
|
-
* Format a trust recovery message for Telegram delivery.
|
|
66
|
-
*/
|
|
67
|
-
static formatTrustRecovery(suggestion: RecoverySuggestion): string;
|
|
68
|
-
/**
|
|
69
|
-
* Format a self-evolution notification for Telegram delivery.
|
|
70
|
-
*/
|
|
71
|
-
static formatEvolutionApplied(opts: {
|
|
72
|
-
proposalTitle: string;
|
|
73
|
-
proposalId: string;
|
|
74
|
-
affectedArea: string;
|
|
75
|
-
confidence: number;
|
|
76
|
-
}): string;
|
|
77
|
-
/**
|
|
78
|
-
* Format a profile change notification for Telegram delivery.
|
|
79
|
-
*/
|
|
80
|
-
static formatProfileChanged(from: AutonomyProfileLevel, to: AutonomyProfileLevel, reason: string): string;
|
|
81
|
-
/**
|
|
82
|
-
* Classify a natural language message into an autonomy intent.
|
|
83
|
-
*/
|
|
84
|
-
private classifyIntent;
|
|
85
|
-
/**
|
|
86
|
-
* Suggest the next elevation step based on current profile.
|
|
87
|
-
*/
|
|
88
|
-
private suggestElevation;
|
|
89
|
-
/**
|
|
90
|
-
* Revert to the previous profile.
|
|
91
|
-
*/
|
|
92
|
-
private revertProfile;
|
|
93
|
-
/**
|
|
94
|
-
* Detect overrides — config values that differ from profile defaults.
|
|
95
|
-
*/
|
|
96
|
-
private detectOverrides;
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=AutonomySkill.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AutonomySkill.d.ts","sourceRoot":"","sources":["../../src/core/AutonomySkill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACjH,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAI9E,MAAM,WAAW,iBAAiB;IAChC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