chore: polish for FOL contract delivery (CHANGELOG, CLI guardrails, metadata)

- Update CHANGELOG.md for 1.1.0 (date, refactoring, repository fixes)
- Add overwrite guardrails to imhotep-cli init — skips existing files
- Add bugs/homepage/keywords metadata to 5 public packages
- Mark imhotep-bench and imhotep-fixtures as private packages
- Add selector field to SourceReference interface (core types)
- Remove 7  casts from check-all.ts (folAst.position, cardinality results)
- Generate package-lock.json for reproducible installs
This commit is contained in:
John Dvorak
2026-05-21 11:58:31 -07:00
parent 4ceb411028
commit 70f528fbab
15 changed files with 3834 additions and 47 deletions
+17 -1
View File
@@ -37,5 +37,21 @@
"imhotep-dsl": "^1.0.0",
"imhotep-solver": "^1.0.0",
"imhotep-reporter": "^1.0.0"
}
},
"bugs": {
"url": "https://gitea.com/anomalyco/imhotep/issues"
},
"homepage": "https://docs.imhotep.dev",
"keywords": [
"testing",
"visual-testing",
"layout-testing",
"relational-testing",
"playwright",
"geometry",
"fol",
"first-order-logic",
"e2e",
"property-testing"
]
}
+7 -8
View File
@@ -121,6 +121,7 @@ export function makeCheckAll(deps: CheckAllDeps): ImhotepUi['checkAll'] {
const validationClauseResults: ClauseResult[] = []
for (let i = 0; i < assertions.length; i++) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const assertion = assertions[i] as any
// Cardinality assertions are evaluated outside the FOL engine.
if (assertion && ['exactlyOne', 'atLeastN', 'atMostN'].includes(assertion.kind)) {
@@ -240,8 +241,8 @@ export function makeCheckAll(deps: CheckAllDeps): ImhotepUi['checkAll'] {
for (const folAst of folFormulas) {
const solverFormula = compileDenseFOLToFormula(folAst)
const selectors = getSelectorsFromFormula(solverFormula)
const sourceRef: SourceReference = (folAst as any).position?.start
? { specLine: (folAst as any).position.start.line, specColumn: (folAst as any).position.start.column }
const sourceRef: SourceReference = folAst.position?.start
? { specLine: folAst.position.start.line, specColumn: folAst.position.start.column }
: {}
checks.push({
clauseId: `clause_${specBase++}`,
@@ -420,11 +421,10 @@ export function makeCheckAll(deps: CheckAllDeps): ImhotepUi['checkAll'] {
metrics: {
observedCount: 0,
expectedCount: cardResult.expectedCount,
selector: cardResult.selector,
} as any,
},
witness: { subjectId: 0, frameId: 0 },
diagnostics: cardResult.diagnostics.map((d) => d.code),
sourceRef: { selector: cardResult.selector } as any,
sourceRef: { selector: cardResult.selector },
clauseLabel: cardResult.label,
})
cardDiagnostics.push(...cardResult.diagnostics)
@@ -481,11 +481,10 @@ export function makeCheckAll(deps: CheckAllDeps): ImhotepUi['checkAll'] {
metrics: {
observedCount: selectorToIds.get(cardResult.selector)?.length ?? 0,
expectedCount: cardResult.expectedCount,
selector: cardResult.selector,
} as any,
},
witness: { subjectId: 0, frameId: 0 },
diagnostics: cardResult.diagnostics.map((d) => d.code),
sourceRef: { selector: cardResult.selector } as any,
sourceRef: { selector: cardResult.selector },
clauseLabel: cardResult.label,
})
allDiagnostics.push(...cardResult.diagnostics)
@@ -984,7 +984,7 @@ describe('Selector Cardinality Contracts (P2.1)', () => {
if (cardClause) {
assert.strictEqual(cardClause.metrics.observedCount, 0)
assert.strictEqual(cardClause.metrics.expectedCount, 1)
assert.strictEqual(cardClause.metrics.selector, '.does-not-exist')
assert.strictEqual(cardClause.sourceRef?.selector, '.does-not-exist')
}
})
})