@really-knows-ai/foundry 3.6.0 → 3.6.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.6.1] - 2026-05-25
4
+
5
+ ### Fixed
6
+
7
+ - Forge contract enforcement now correctly handles the first forge run with no prior feedback items (empty batch). Previously the contract failed with "forge changed artefacts but did not mark any feedback as actioned", creating a system feedback item that cascaded into an infinite forge loop.
8
+ - Forge history entries now include the actual list of changed files detected by git diff, instead of showing an empty `changed_files: []` for every entry.
9
+
3
10
  ## [3.6.0] - 2026-05-25
4
11
 
5
12
  ### Added
@@ -76,15 +76,24 @@ function checkBatchVersion(items, feedbackStore, cycleId, postVersion, preVersio
76
76
  /**
77
77
  * Enforce the forge contract on a batch of items presented to forge.
78
78
  *
79
- * Two-level check:
79
+ * When `items` is not a non-empty array (null, undefined, or []), the
80
+ * contract passes immediately without side-effects. This covers the
81
+ * initial forge run where no feedback exists yet.
82
+ *
83
+ * Two-level check when items are present:
80
84
  * 1. Per-item: every item must end in 'actioned' or 'wont-fix'.
81
85
  * 2. Batch-level: artefact version semantics must be consistent.
82
86
  *
83
- * @param {{ items: Array<{id: string}>, preVersion: string, postVersion: string,
84
- * feedbackStore: object, cycleId: string }} params
87
+ * @param {{ items?: Array<{id: string}> | null, preVersion: string,
88
+ * postVersion: string, feedbackStore: object, cycleId: string }} params
85
89
  * @returns {{ contractPassed: boolean }}
86
90
  */
87
91
  export function enforceForgeContract({ items, preVersion, postVersion, feedbackStore, cycleId }) {
92
+ if (!Array.isArray(items) || items.length === 0) {
93
+ // Empty batch means forge had no prior feedback to respond to.
94
+ // This is the first forge run or all items were already resolved.
95
+ return { contractPassed: true };
96
+ }
88
97
  if (!checkPerItemResponse(items, feedbackStore, cycleId, postVersion)) {
89
98
  return { contractPassed: false };
90
99
  }
@@ -307,7 +307,9 @@ export async function finaliseStage(args) {
307
307
  const iteration = getIteration(historyPath, cycleId, io);
308
308
  const openFeedback = computeOpenFeedback(io);
309
309
  writeHistoryEntries({
310
- historyPath, cycleId, lastStage, iteration, openFeedback, io,
310
+ historyPath, cycleId,
311
+ lastStage: { ...lastStage, changedFiles: finalizeResult.changedFiles },
312
+ iteration, openFeedback, io,
311
313
  artefactVersion: postVersion, contractPassed,
312
314
  });
313
315
  const commitErr = await tryStageCommit(git, lastStage, cycleId, io);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@really-knows-ai/foundry",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "A skill-driven framework for governed artefact generation with AI coding tools. Define your own artefact types, laws, and flows — Foundry handles the forge → quench → appraise pipeline with deterministic routing, quality gates, and iterative refinement.",
5
5
  "type": "module",
6
6
  "main": "dist/.opencode/plugins/foundry.js",