diff --git a/CHANGELOG.md b/CHANGELOG.md index d8d49e71..76fa8c4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,10 @@ Categories: **Added** · **Changed** · **Fixed** · **Removed** · **Internal** ### Fixed +- **Experience collection public API gap**: `ExperienceLog`, its entry/options types, and `createObjectiveVerifierHook` are now exported from the documented `@rdk-moss/agent/memory` and `/core` subpaths, so clean downstream builds no longer depend on private source paths. + +- **Workspace hygiene now checks Git tracking semantics**: the root `AGENTS.md` guard queries the Git index instead of only testing whether a file exists, so a local untracked or ignored instruction file can no longer make the fresh-clone requirement pass incorrectly. + - **pre-push gates could never block**: the hook piped each check through `tail` without `pipefail`, so the pipeline exit status was always tail's 0 and every gate silently passed even when the underlying check failed. The hook now runs `set -e -o pipefail`; verified by injecting a type error (hook exits 1) and removing it (hook passes). - **Trusted self-evolution rollback and experiment hardening**: rollback now removes only coordinator-owned artifacts instead of recursively deleting a learned-skill directory, validates backup filenames while retaining legacy backup compatibility, preserves both publication and restoration errors, reuses Skill registries, parses generated Skill documents without a multiline-regex dependency, validates experiment thresholds, and uses a stable 32-bit A/B allocation sample. ISP tuning captures now use an isolated run directory with explicit convergence and timeout parameters. diff --git a/packages/moss-agent/src/core/index.ts b/packages/moss-agent/src/core/index.ts index eff6ddc2..e6f7c8d7 100644 --- a/packages/moss-agent/src/core/index.ts +++ b/packages/moss-agent/src/core/index.ts @@ -9,6 +9,10 @@ export type { ToolApprovalRequest, ToolApprovalDecision, } from './agent/index.js'; +export { + createObjectiveVerifierHook, + type ObjectiveVerifierDeps, +} from './tools/objective-verifier-hook.js'; export { CommandQueueRegistry } from './agent/index.js'; export type { EnqueueOpts } from './agent/index.js'; export { MossAgent } from './agent/index.js'; diff --git a/packages/moss-agent/src/memory/index.ts b/packages/moss-agent/src/memory/index.ts index 7aab35ea..c3ad08c5 100644 --- a/packages/moss-agent/src/memory/index.ts +++ b/packages/moss-agent/src/memory/index.ts @@ -50,6 +50,12 @@ export { export { cosineSimilarity, hybridScore } from './memory-embedding.js'; export type { MemoryEmbeddingProvider, EmbeddedMemoryEntry } from './memory-embedding.js'; +export { + ExperienceLog, + type ExperienceEntry, + type ExperienceLogOptions, +} from './experience-log.js'; + export { LearningEventLog, type LearningEvent, diff --git a/packages/moss-agent/test/public-experience-api.spec.mjs b/packages/moss-agent/test/public-experience-api.spec.mjs new file mode 100644 index 00000000..27938426 --- /dev/null +++ b/packages/moss-agent/test/public-experience-api.spec.mjs @@ -0,0 +1,8 @@ +import assert from 'node:assert/strict'; +import { createObjectiveVerifierHook } from '../dist/core/index.js'; +import { ExperienceLog } from '../dist/memory/index.js'; + +assert.equal(typeof ExperienceLog, 'function'); +assert.equal(typeof createObjectiveVerifierHook, 'function'); + +console.log('[PASS] public experience collection APIs are exported from package subpaths'); diff --git a/scripts/check-workspace-hygiene.mjs b/scripts/check-workspace-hygiene.mjs index c294343b..afd8d9fd 100644 --- a/scripts/check-workspace-hygiene.mjs +++ b/scripts/check-workspace-hygiene.mjs @@ -1,6 +1,7 @@ #!/usr/bin/env node import fs from 'node:fs'; import path from 'node:path'; +import { spawnSync } from 'node:child_process'; import { fileURLToPath } from 'node:url'; const repoRoot = path.resolve(fileURLToPath(new URL('..', import.meta.url))); @@ -96,7 +97,12 @@ if (!expectedNode) { // fresh clone gives coding agents project instructions (architecture // constraints, dependency direction, validation routes) instead of zero // context. Local-only instruction files (gitignored) do not count. -if (!fs.existsSync(path.join(repoRoot, 'AGENTS.md'))) { +const trackedAgentsFile = spawnSync( + 'git', + ['ls-files', '--error-unmatch', '--', 'AGENTS.md'], + { cwd: repoRoot, encoding: 'utf8', windowsHide: true }, +); +if (trackedAgentsFile.status !== 0) { findings.push('AGENTS.md: missing root agent instructions file (must be tracked, not gitignored)'); }