@ccx-agent/opencode-ccx 0.7.0 → 0.8.0

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.
@@ -2,7 +2,11 @@ import type { OhMyCCAgentConfig } from "../config/schema";
2
2
  export declare function createVerificationReminder(config: OhMyCCAgentConfig): (input: unknown, _output: unknown) => Promise<void>;
3
3
  export declare function getVerificationState(sessionID: string): {
4
4
  editedFilesCount: number;
5
+ dirtyFilesCount: number;
5
6
  verificationTriggered: boolean;
6
7
  };
7
8
  export declare function listEditedFiles(sessionID: string, limit?: number): string[];
9
+ export declare function listDirtyFiles(sessionID: string, limit?: number): string[];
10
+ export declare function markVerificationStarted(sessionID: string): void;
11
+ export declare function getIncrementalVerificationContext(sessionID: string): string | null;
8
12
  export declare function requiresVerification(sessionID: string, minFileEdits: number): boolean;
package/dist/index.js CHANGED
@@ -25010,6 +25010,8 @@ Execute verification directly in this session. Delegate again only when the call
25010
25010
  === WHAT YOU RECEIVE ===
25011
25011
  You will be given: the original task specification, the list of changed files, the implementation approach, and optionally a path to a plan or spec document.
25012
25012
 
25013
+ You may also receive an "Incremental Verification Context" with dirty files and previous verification baselines from this session. Treat it as a cache hint, not proof. Prefer targeted verification of dirty files and their affected dependencies. Re-run full build/test/lint only when the dirty set includes broad-impact files such as dependency manifests, lockfiles, build config, shared test config, public API barrels, schemas, migrations, or infrastructure config; when the previous baseline was FAIL/PARTIAL; or when impact cannot be bounded.
25014
+
25013
25015
  === VERIFICATION STRATEGY ===
25014
25016
  Tailor your approach to the nature of the changes:
25015
25017
 
@@ -25027,10 +25029,11 @@ Tailor your approach to the nature of the changes:
25027
25029
 
25028
25030
  === REQUIRED STEPS (universal baseline) ===
25029
25031
  1. Read the project's CLAUDE.md / README to discover build commands, test commands, and conventions. Inspect package.json / Makefile / pyproject.toml for available scripts. If the implementer referenced a plan or specification document, read it \u2014 that defines the success criteria.
25030
- 2. Execute the build (when applicable). A build that fails is an immediate FAIL.
25031
- 3. Execute the project's test suite (when one exists). Test failures are an immediate FAIL.
25032
- 4. Run any configured linters or type checkers (eslint, tsc, mypy, etc.).
25033
- 5. Inspect related code for regressions.
25032
+ 2. Determine whether verification can be incremental. If the Incremental Verification Context shows only localized dirty files, choose the narrowest build/test/typecheck/lint commands that exercise those files and their dependents. If risk cannot be bounded, use the full commands.
25033
+ 3. Execute the selected build or typecheck command when applicable. A relevant build/typecheck failure is an immediate FAIL.
25034
+ 4. Execute the selected test suite or targeted tests when they exist. Relevant test failures are an immediate FAIL.
25035
+ 5. Run configured linters only for affected files when the tooling supports it; otherwise run the full linter only for broad-impact changes.
25036
+ 6. Inspect related code for regressions.
25034
25037
 
25035
25038
  After the baseline, apply the type-specific strategy from above. Scale your thoroughness to match the stakes: a disposable utility script does not require concurrency analysis; production payment processing demands exhaustive coverage.
25036
25039
 
@@ -25065,6 +25068,8 @@ You discovered something that appears broken. Before declaring FAIL, ensure you
25065
25068
  Do not abuse these as reasons to dismiss genuine problems \u2014 but equally, do not FAIL on behavior that was deliberately chosen.
25066
25069
 
25067
25070
  === OUTPUT FORMAT (REQUIRED) ===
25071
+ Start with one short line: "+ Scope: incremental" or "+ Scope: full", followed by the reason.
25072
+
25068
25073
  Every individual check MUST use this structure. Any check missing a Command run block is not a PASS \u2014 it is a skip.
25069
25074
 
25070
25075
  \`\`\`
@@ -25550,6 +25555,8 @@ function getSessionState(sessionID) {
25550
25555
  }
25551
25556
  const created = {
25552
25557
  editedFiles: new Set,
25558
+ dirtyFiles: new Set,
25559
+ verificationBaselines: [],
25553
25560
  verificationTriggered: false
25554
25561
  };
25555
25562
  sessionStateById.set(sessionID, created);
@@ -25577,7 +25584,7 @@ function createVerificationReminder(config2) {
25577
25584
  const subagentType = typeof rawArgs.subagent_type === "string" ? rawArgs.subagent_type.toLowerCase() : typeof rawArgs.subagentType === "string" ? rawArgs.subagentType.toLowerCase() : "";
25578
25585
  const verificationSubagent = `${config2.agent_name}-verification`;
25579
25586
  if (subagentType === verificationSubagent || subagentType === "verification") {
25580
- getSessionState(sessionID).verificationTriggered = true;
25587
+ markVerificationStarted(sessionID);
25581
25588
  }
25582
25589
  return;
25583
25590
  }
@@ -25590,12 +25597,14 @@ function createVerificationReminder(config2) {
25590
25597
  }
25591
25598
  const state = getSessionState(sessionID);
25592
25599
  state.editedFiles.add(filePath);
25600
+ state.dirtyFiles.add(filePath);
25593
25601
  };
25594
25602
  }
25595
25603
  function getVerificationState(sessionID) {
25596
25604
  const state = getSessionState(sessionID);
25597
25605
  return {
25598
25606
  editedFilesCount: state.editedFiles.size,
25607
+ dirtyFilesCount: state.dirtyFiles.size,
25599
25608
  verificationTriggered: state.verificationTriggered
25600
25609
  };
25601
25610
  }
@@ -25603,6 +25612,45 @@ function listEditedFiles(sessionID, limit = 20) {
25603
25612
  const state = getSessionState(sessionID);
25604
25613
  return [...state.editedFiles].slice(-limit);
25605
25614
  }
25615
+ function markVerificationStarted(sessionID) {
25616
+ const state = getSessionState(sessionID);
25617
+ state.verificationTriggered = true;
25618
+ const files = [...state.dirtyFiles];
25619
+ if (files.length === 0)
25620
+ return;
25621
+ state.verificationBaselines.push({
25622
+ files,
25623
+ createdAt: Date.now()
25624
+ });
25625
+ state.dirtyFiles.clear();
25626
+ if (state.verificationBaselines.length > 5) {
25627
+ state.verificationBaselines = state.verificationBaselines.slice(-5);
25628
+ }
25629
+ }
25630
+ function getIncrementalVerificationContext(sessionID) {
25631
+ const state = getSessionState(sessionID);
25632
+ const dirtyFiles = [...state.dirtyFiles];
25633
+ const previousBaselines = state.verificationBaselines.slice(-3);
25634
+ if (dirtyFiles.length === 0 && previousBaselines.length === 0)
25635
+ return null;
25636
+ const lines = [
25637
+ "# Incremental Verification Context",
25638
+ "Use this to avoid rerunning unrelated full verification. Reuse previous conclusions only when the affected files and commands are unchanged; run fresh checks for dirty files and their dependencies."
25639
+ ];
25640
+ if (dirtyFiles.length > 0) {
25641
+ lines.push("", `Dirty files since last verification (${dirtyFiles.length}):`, ...dirtyFiles.map((file2) => `- ${file2}`));
25642
+ } else {
25643
+ lines.push("", "Dirty files since last verification: none tracked.");
25644
+ }
25645
+ if (previousBaselines.length > 0) {
25646
+ lines.push("", "Previous verification baselines in this session:");
25647
+ for (const baseline of previousBaselines) {
25648
+ lines.push(`- ${new Date(baseline.createdAt).toISOString()}: ${baseline.files.join(", ")}`);
25649
+ }
25650
+ }
25651
+ return lines.join(`
25652
+ `);
25653
+ }
25606
25654
  function requiresVerification(sessionID, minFileEdits) {
25607
25655
  const state = getSessionState(sessionID);
25608
25656
  return state.editedFiles.size >= minFileEdits && !state.verificationTriggered;
@@ -25747,6 +25795,10 @@ function formatSessionEditedFiles(sessionID, limit) {
25747
25795
  Files edited in this session (${files.length} total): ${files.join(", ")}`;
25748
25796
  return header;
25749
25797
  }
25798
+ function getSubagentType(args2) {
25799
+ const raw = typeof args2.subagent_type === "string" ? args2.subagent_type : typeof args2.subagentType === "string" ? args2.subagentType : "";
25800
+ return raw.toLowerCase();
25801
+ }
25750
25802
  function createContextBundleHook(args2) {
25751
25803
  const { config: config2, directory } = args2;
25752
25804
  return async (input, output) => {
@@ -25791,6 +25843,15 @@ ${recent}`);
25791
25843
  if (editedSummary) {
25792
25844
  bundleParts.push(editedSummary);
25793
25845
  }
25846
+ const verificationSubagent = `${config2.agent_name}-verification`;
25847
+ const subagentType = getSubagentType(output.args);
25848
+ const isVerificationTask = subagentType === verificationSubagent || subagentType === "verification";
25849
+ if (sessionID && isVerificationTask) {
25850
+ const incrementalContext = getIncrementalVerificationContext(sessionID);
25851
+ if (incrementalContext) {
25852
+ bundleParts.push(incrementalContext);
25853
+ }
25854
+ }
25794
25855
  if (bundleParts.length === 0)
25795
25856
  return;
25796
25857
  const bundle = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccx-agent/opencode-ccx",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Production-grade prompt engineering for OpenCode — disciplined coding, risk-aware actions, adversarial verification",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",