Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/unreleased/110-parse-anomaly-metadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

- Accept the documented bold metadata form in anomaly triage entries while retaining compatibility with the legacy colon placement. Explicit severity, file, relatedness, and downstream-repo routing fields are no longer discarded.
2 changes: 1 addition & 1 deletion .github/workflows/anomaly-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
const fields = {};
const bodyLines = [];
for (const line of rest.split('\n')) {
const m = /^-\s+\*\*([^*]+)\*\*:\s*(.+)$/.exec(line);
const m = /^-\s+\*\*([^*:]+?)(?::\*\*|\*\*:)\s*(.+)$/.exec(line);
if (m) {
fields[m[1].trim().toLowerCase()] = m[2].trim();
} else {
Expand Down
9 changes: 9 additions & 0 deletions docs/repo-update-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ This log records agent-visible repository changes that should be easy to audit l
- **Propagation:** none | pending <repo/path> | completed <repo/path>
```

## 2026-07-09 - Anomaly-triage documented metadata parsing

- **Issue/PR:** #110 / #111
- **Branch:** agent/codex/110-parse-anomaly-metadata
- **Changed paths:** .github/workflows/anomaly-triage.yml, scripts/workflow-structure.test.mjs, .changelog/unreleased/110-parse-anomaly-metadata.md, docs/repo-update-log.md
- **What changed:** The anomaly parser now accepts both the documented `**Field:** value` metadata form and the legacy `**Field**: value` form. The former previously lost severity, file, explicit relatedness, and downstream-repo fields, which a live #106 proof exposed when `Related to PR: yes` was routed as an unrelated issue.
- **Verification:** TDD RED: `npx vitest run scripts/workflow-structure.test.mjs` reported 1 failed / 22 passed for the documented colon placement. GREEN: the same command reported 23 passed. Full `npm test` reported 9 files / 181 tests passed. `C:\Users\josep\go\bin\actionlint.exe .github\workflows\anomaly-triage.yml` and `git diff --check` exited 0; the latter emitted only a working-tree LF-to-CRLF warning.
- **Propagation:** pending `v1` tag movement and `archon-setup` reusable-workflow snapshot refresh after merge; callers do not change.

## 2026-07-09 - Anomaly-triage caller write permissions

- **Issue/PR:** #106 / #107
Expand Down
33 changes: 33 additions & 0 deletions scripts/workflow-structure.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,39 @@ describe('anomaly-triage caller permission contract', () => {
});
});

describe('anomaly-triage metadata parser contract', () => {
it('accepts the documented and legacy bold-field colon placement', () => {
const body = readWorkflow('anomaly-triage');
const parserLine = body
.split(/\r?\n/)
.find((line) => line.includes('const m = /^-'));
const regexSource = parserLine?.match(/const m = \/(.+)\/\.exec\(line\);/)?.[1];

expect(regexSource).toBeTruthy();
const metadataLine = new RegExp(regexSource);

const documentedFields = Object.fromEntries(
[
'- **Severity:** high',
'- **File:** src/example.mjs',
'- **Related to PR:** yes',
'- **Downstream repo:** ArchonVII/example',
].map((line) => metadataLine.exec(line)?.slice(1)),
);

expect(documentedFields).toEqual({
Severity: 'high',
File: 'src/example.mjs',
'Related to PR': 'yes',
'Downstream repo': 'ArchonVII/example',
});
expect(metadataLine.exec('- **Related to PR**: yes')?.slice(1)).toEqual([
'Related to PR',
'yes',
]);
});
});

describe('pr-policy workflow contract source', () => {
it('uses the shared PR contract validator instead of inline body regexes', () => {
const body = readWorkflow('pr-policy');
Expand Down