Skip to content

Deliver open issues: repeated-names, move-value, media set, list --with, refs, and per-row FORM in media add --batch - #114

Merged
cacack merged 11 commits into
mainfrom
milestone/open-issues
Nov 28, 2026
Merged

cacack merged 11 commits into
mainfrom
milestone/open-issues

Conversation

@cacack

@cacack cacack commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Summary

This branch delivers six open issues. It adds four commands: repeated-names reports and folds names a person holds twice, move-value moves event values into their PLAC, ADDR or a NOTE from a table, media set sets the FILE of an existing OBJE record, and refs lists the records that point at an xref. It also adds list --with, which prints chosen tag paths as extra columns, and lets media add --batch rows carry their own FORM. Each command wraps gedcom-go v3.17.0 calls, and make check passes on the rebased branch.

Changes

  • feat: add repeated-names, which reports and folds names a person holds twice
  • refactor: indent repeated report help in one place and pin help tests to the shared rule
  • feat: add move-value, which moves event lines' values into their PLAC, ADDR or a NOTE from a table
  • fix: refuse prepend PLAC onto a PLAC with a FORM or TRAN, and reject an empty move-value table
  • feat: add media set, which sets the FILE of an existing OBJE record
  • fix: report the FILE media set leaves, and test its FORM handling
  • feat: add list --with, which adds chosen tag paths as columns
  • fix: reject a --with path given twice, and test every record type's columns
  • feat: add refs, which lists the records that point at an xref
  • feat: let media add --batch rows carry their own FORM
  • refactor: pass media add's --batch FORM fallback explicitly

Issues

#93 — list: show name parts and a person's later names; report names repeated in one record

Refs #93

  • AC1 (one row per NAME with all fields; JSON keys the same; an absent part is empty): met. list names already had these columns before this branch. TestListNames and TestListNamesEmptyValue check them.
  • AC2 (three NAME lines give three rows in file order): met. TestListNames and TestListNamesRepeated check it.
  • AC3 (report repeated names and GIVN/SURN mismatches; empty output with exit 0 on a clean file): partly met. list --repeated names and the new repeated-names command report repeats, and validate --style NAME_PART_MISMATCH reports mismatches (TestRepeatedNamesReport). This departs from the issue: same_as now uses gedcom.SamePersonalName, which compares words and treats punctuation as a separator. The issue asks to ignore punctuation, so "O'Brien" no longer equals "OBrien" (TestListNamesSameAsWords). For that reason this PR uses Refs, not Closes.
  • AC4 (--redact-living applies to the listing and the report): met. TestListNamesRedactLiving covers it, along with the repeated-names rows in TestRedactLiving and the unredacted-file check in TestRedactLivingWholeFiles.
  • AC5 (--help states the fields and the equality rule): met. Both commands' help embeds the shared samePersonalNameHelp. TestListHelpHasExample and TestRepeatedNamesHelp assert it.
  • AC6 (fold: one NAME keeps every distinct citation once, no other line changes, the input is not modified): met. TestRepeatedNamesFold compares the whole output file and the input. There is a writeCommands round-trip entry.

#107 — move-value: move an event line's value into its PLAC, ADDR or a NOTE, from a table

Closes #107

  • AC1 (prepend PLAC writes the joined PLAC with no MAP and no ADDR; other lines are byte-identical): TestMoveValueChangesOnlyTheMatchedLines/"prepend PLAC" compares the whole output.
  • AC2 (*.PLAC "at home" to NOTE with a prefix): TestMoveValueChangesOnlyTheMatchedLines/"to NOTE with a prefix".
  • AC3 (to ADDR onto an existing ADDR, or prepend PLAC with no PLAC, exits 1, writes nothing and names the record and line): TestMoveValueRefused.
  • AC4 (substructures the action does not account for exit 1 with no file written): TestMoveValueRefused "a MAP under the line" and "a CITY under the line".
  • AC5 (matching is exact, CONT included; unmatched rows are listed with exit 0): the CONT, CONC and exact-path cases, and TestMoveValueJSON (unmatched=[4]).
  • AC6 (counts per row and in total, in text and JSON; -o - splits stdout from stderr): TestMoveValueChangesOnlyTheMatchedLines, TestMoveValueJSON and TestMoveValueStdout.
  • AC7 (--redact-living hides values, the file is not redacted, the README names the command): living_test.go rows and the README conventions list.
  • AC8 (tests go through cli.Run; the command is in writeCommands and TestRedactLiving; help and README document it): roundtrip_test.go, living_test.go, the Long help and the README ### move-value section.

#108 — media: set the FILE of an existing OBJE record

Closes #108

  • AC1 (one command sets FILE, keeps FORM and TITL, and leaves other records byte-identical): TestMediaSetEmptyFile byte comparison. There is a writeCommands "media set" entry.
  • AC2 (--root refuses an absolute path, a path that climbs out and a missing file; exits 1, writes nothing, names the row): TestMediaSetRefuses and TestMediaSetBatchAllOrNone.
  • AC3 (a non-OBJE record and a different FILE are refused without a flag; the same path is reported unchanged): TestMediaSetRefuses, TestMediaSetReplace and the second run in TestMediaSetEmptyFile.
  • AC4 (TSV batch with optional FORM, applied all or none, two records may share a path): TestMediaSetBatch and TestMediaSetBatchAllOrNone.
  • AC5 (help and README; tests via cli.Run; in writeCommands): the Long help, the README table row and section, the redaction list and roundtrip_test.go.

#109 — list: print chosen tag paths as extra columns

Closes #109

  • AC1 (extra columns from tag paths): the repeatable --with flag. TestListWith checks the issue's example and every record type.
  • AC2 (missing, repeated and JSON values): TestListWith covers empty cells, " | " joins in text and arrays in JSON.
  • AC3 (a path under the wrong type is rejected and named): TestListWithWrongPath. This departs from the issue: it exits 2 (ExitUsage, this CLI's code for command-line mistakes, the same as list --tag), not 1.
  • AC4 (--redact-living): the "list with" and "list with json" rows in TestRedactLiving.
  • AC5 (--help states the column order, repeated values and CONT handling): the list help text, checked by TestListHelpHasExample.

#110 — List the records that point at an xref

Closes #110

  • AC1 (read-only, one line per pointer with holder, tag path and target, exit 0): TestRefsText "one xref" and "header".
  • AC2 (an unreferenced record prints nothing with exit 0; an undefined xref exits 1 with an error on stderr): TestRefsText/"nothing points at it" and TestRefsExitCodes/"no such record".
  • AC3 (several xrefs or - on stdin in one pass, each line naming its target): TestRefsText/"several" and TestRefsStdin.
  • AC4 (--format json uses delete's keys): TestRefsJSON checks from, path and to, and [] when empty.
  • AC5 (--redact-living leaves output unchanged, and the help says so): a living_test.go row, the Long help and the README. Note: a pointer a record holds to itself is not listed, and the help says so.

#111 — media add --batch: take a FORM per row

Closes #111

  • AC1 (a fourth FORM column; rows without it work as before): TestMediaAddBatchForm. The existing batch tests pass unchanged.
  • AC2 (with --batch, --form fills in only rows that give no FORM and have an unknown extension; --help says so): TestMediaAddBatchForm, the flag help and the README.
  • AC3 (the issue's .xcf/.png batch exits 0 and writes image/x-xcf and image/png): TestMediaAddBatchForm.
  • AC4 (an unknown FORM is reported by line and nothing is written): TestMediaAddBatchFormUnknown.

Panel Review

Each issue was panel-reviewed separately (6 personas) and valid findings fixed before integration.


🤖 Generated with Claude Code

Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh

cacack and others added 11 commits November 26, 2026 15:12
…s twice

repeated-names wraps gedcom-go's merge.RepeatedNames and
FoldRepeatedNames, sharing repeated-events' report, --fold and -o
handling. list names now computes same_as with gedcom.SamePersonalName
instead of a local key, so both commands compare name values by the
library's rule: the same words in the same order, case ignored. The
list help points to repeated-names and to validate --style
NAME_PART_MISMATCH for parts that disagree with the value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
… to the shared rule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
…, ADDR or a NOTE from a table

A tab-separated table names a tag path (or *.<TAG> for any event), the
exact whole value and an action: prepend PLAC (removing the PLAC's MAP),
to ADDR, to PLAC, or to NOTE with a prefix. A line the action cannot be
applied to, or a move that adds a validation finding, stops the write;
a row that matches nothing is reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
…an empty move-value table

A FORM or TRAN under the PLAC describes the old value, so prepending to
it is refused as "described". Prepending to an empty PLAC no longer
leaves a trailing separator. A table with no header row is an error
rather than a silent no-op. Refusal reasons are named constants, and the
text report no longer splices a format string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
media set --obje <xref> --path <path> [--form <form>], or --batch rows of
xref, path and an optional FORM, fills the FILE of an OBJE record in place,
so the record keeps its xref, title and links. A FILE holding another path
needs --replace, a record with several FILE lines is refused, --root checks
each path as media add does, and a batch is applied whole or not at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
media set now reports the path FILE holds after the edit, so a FILE that
already named the path under another spelling is reported as spelled. The
decision to write FILE is recorded when the row is checked rather than
re-derived when it is applied, and the help says "set" also covers a
FORM-only change. Tests cover a FORM-only change and the GEDCOM 5.5 layout
with FORM beside FILE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
A record type's listing takes a repeatable --with <path> and prints each
record's values at the path after the type's own fields: every line in file
order with its CONT and CONC lines folded in, joined by " | " in text and as
an array under a "with" object in JSON. A path under another record type is
a usage error, and a record --redact-living hides has no values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
…olumns

JSON keys the --with values by path, so a repeated path was one key there
but two columns in text. It is now a usage error. The test for the other
record types checks whole rows, for each type, not only the first column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
refs prints one line per pointer to each record given: the record
holding it, the tag path to it and the record pointed at, as delete
reports the pointers that stop it. It reads xrefs from stdin with "-",
reads the file once, and prints JSON with delete's from, path and to
keys. The output is xrefs and tag paths only, so --redact-living does
not change it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
A batch row may give a fourth column, FORM, used for the new OBJE record
it creates. With --batch, --form now only fills in rows that give no FORM
and whose extension gives none, so one batch can mix file types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
Single-row mode no longer clears the --form value to keep it out of the
fallback, and a test pins the single-row "pass --form" hint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSVrYUmhKiXygF7aH9j9Fh
@cacack

cacack commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

Unverified review dismissals

Review of #93 at d187a65 (review before step 3's fixes). Lines a panel reviewer examined but could not clear — the boundary of the review, not findings and not clearance.

  • 'internal/cli/list.go' ('SameAs' is 0 for empty or no-word values) — the help says "a value with no words equals none". I did not trace the library's handling of an empty 'Full'. **unverified**
  • 'internal/cli/repeated_events.go' ('g.Members[0].Tags[0].Tag') — I did not check that 'Members' is never empty. The library only emits groups of 2 or more, as the existing 'repeated-events' path already assumed. **unverified**
  • 'internal/cli/list.go' removal of 'nameKey' — grep for remaining references and the 'unicode'/'strings' imports was not run. I assume the build passes, since the harness ran tests. **unverified**
  • 'internal/cli/repeated_events.go:225' ('g.Members[0].Tags[0].Tag') — the same expression as before, now applied to 'NameGroup' members. Whether the library guarantees non-empty 'Tags' for name members was not traced. **unverified**
  • 'internal/cli/list.go' (nameRows 'SameAs' via 'slices.IndexFunc') — comparison count is bounded by k² for k names of one person; k is small in real files. The nil guard is present. **unverified**: I did not read 'gedcom.SamePersonalName', so its per-call allocation is unknown.
  • 'internal/cli/repeated_names.go:477-487' — 'find' maps 'merge.NameGroup' to 'repeatedFound'. **unverified**: I did not read the vendored gedcom-go 'merge.RepeatedNames' / 'NameGroup' / 'SamePersonalName' to confirm that the documented rule (slashes as separators, one piece per tag) matches the libra
  • 'internal/cli/repeated_events.go:128-165' — The '--output' handling is unchanged: '-o' without '--fold' is rejected, and 'outputPath' is called with 'args[0]'. The README says it refuses to overwrite the input file. I did not trace 'outputPath' itself, since it is not in the diff, so this is **unver
  • 'internal/cli/repeated_events.go:222-231' — Report redaction for names is keyed on 'hidden[g.XRef]', and 'hiddenRecords' fills it from presumed-living individuals. Names belong to individuals only, so the lookup covers every name group. The 'Living' redaction is applied through 'newMergedPart(m, hid
  • **unverified**: I did not trace 'newMergedPart' redaction internals beyond confirming the hidden flag reaches it; that code is unchanged.
  • Skeptic/Maintainer unverified: g.Members[0].Tags[0] is non-empty for name groups. The Tracer traced it to gedcom-go v3.17.0 merge/repeated_names.go:14 ('at least two' members, each starting with its NAME tag). I did not re-trace it myself.

@cacack

cacack commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

Unverified review dismissals

Review of #107 at 69ff9cf (review before step 3's fixes). Lines a panel reviewer examined but could not clear — the boundary of the review, not findings and not clearance.

  • Test files and 'testdata/move-value.ged' — **unverified**: not read in detail.
  • Redaction of 'Value' in per-row stats uses 'hidden[m.record]'. **Unverified**: I did not check that 'hiddenRecords' keys match the '*gedcom.Record' pointers in 'doc.Records'. It is the same pattern as the other commands.
  • 'internal/cli/move_value.go:~470-490' ('applyMove' prepend) — I checked 'RemoveChildren' before 'SetFullValue', and 'slices.Delete(... len(Subtree(m.line)))' run after both. The delete range is computed on the post-edit tags, and the 'plac' pointer is not invalidated. Covered by the "prepend PLAC" t
  • 'internal/cli/testdata/move-value.ged' — the fixture line numbers (19, 20, 22, 24, 38, 39) are asserted in tests. I did not recount each against the file, so **unverified** beyond the suite passing in CI.
  • 'internal/cli/move_value.go' (output write) — the output is written through 'writeOutput' and the diff shows no unbounded 'io.ReadAll'. **unverified**: I did not trace 'writeOutput' or 'decodeForWrite' for file or handle closing, because they are pre-existing shared helpers.
  • JSON 'unmatched' and 'refused' are initialized to '[]', not null. 'counts' is the zero value when refused. I did not check its marshaled shape: **unverified**.
  • The '-o' handling, 'outputPath', 'writeOutput', 'decodeForWrite', 'addedFindings' and 'hiddenRecords' helpers are shared with 'retag'/'name'. I did not re-trace them: **unverified**.
  • 'record.RemoveChildren', 'SetFullValue' and 'Subtree' semantics are from the gedcom-go library. I did not read them: **unverified**.
  • 'move_value.go:~148' ('outputPath(cmd, args[0], args[1])') — **unverified**: I did not read 'outputPath', 'writeOutput' or 'decodeForWrite'. They are pre-existing shared helpers that other commands use. The help text says '-o' may not name the input or the table, and that an existing output file is
  • 'move_value.go:~455' ('slices.Delete(record.Tags, i, i+len(record.Subtree(m.line)))') — the subtree length is computed from the same record. Refusal of matches with substructures happens earlier, and CONC/CONT lines are the only children. I did not trace 'Subtree' inside the library for malformed le

@cacack

cacack commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

Unverified review dismissals

Review of #108 at cef7d43 (review before step 3's fixes). Lines a panel reviewer examined but could not clear — the boundary of the review, not findings and not clearance.

  • 'living_test.go', 'roundtrip_test.go', README — the added entries are consistent with the new command. I did not verify that README prose about redaction matches runtime behavior beyond the existing list. **unverified**: I did not read the redaction code to confirm 'media set' writes unredacted. The
  • 'internal/cli/media_set.go:121-130' (batch parse) — reuses 'readBatch' with min 2 and max 3 fields, as 'readMediaBatch' does for 'media add'. **unverified**: I did not read 'readBatch' itself.
  • 'internal/cli/media_set.go:~170-190' ('findRecords' per row) — **unverified**: 'doc.GetRecord' in the library was not traced. 'findRecords' itself ('get.go:101-122') does no scanning, only two 'GetRecord' calls p
  • 'internal/cli/media_set.go' '--form' semantics — the FORM is written where 'mediaForm' reads it (under FILE, or the 5.5 layout beside it). Not exercised with the 5.5 layout in tests, so this is **unverified**.
  • Normalization behavior of 'normalizeMediaPath' ('internal/cli/media.go:49') — **unverified**: I did not read the function body.
  • 'readBatch' and 'findRecords' internals: **unverified**. I did not trace them for size limits or file-read handling. They are pre-existing and shared with 'media add'.
  • Encoder newline handling for FILE/FORM: **unverified**, as described in the finding above.

@cacack

cacack commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

Unverified review dismissals

Review of #109 at e9baf30 (review before step 3's fixes). Lines a panel reviewer examined but could not clear — the boundary of the review, not findings and not clearance.

  • 'internal/cli/list.go', 'record.FullValue' for CONT/CONC folding: 'TestListWith' asserts "First second line" in text and "First\nsecond line" in JSON. **unverified**: I did not read the library's 'FullValue' or the text sanitizer.
  • 'internal/cli/living_test.go': the new cases show a redacted record yields empty values. **unverified**: I did not trace where redaction is applied relative to 'record.FindAll'.
  • 'internal/cli/list.go:~405-420', 'FindAll' and 'FullValue' per record per path. This runs only inside the 'rowsOf' limit, so '--limit N' bounds it to N rows. I did not read 'FindAll' or 'FullValue' in the library, so I did not confirm that 'FindAll' is a plain subtree walk. **unverified**
  • 'internal/cli/list.go:373-395' (listRows switch) — **unverified**: 'recordRows' now iterates 'doc.Records' with the typed getters where 'doc.Individuals()' and similar were used before. I did not confirm that the two give the same order and set, for example for records the library skips or for 'obje
  • 'internal/cli/list.go:395' ('default' now routes to 'valueRows') — **unverified**: this is safe only if 'kind' is validated against 'listTypes' earlier. I did not trace that check.
  • 'list.go:~395-425' ('recordRows') — the '--limit' and allocation behavior is unchanged, since it goes through 'rowsOf'. Per-record work is bounded by the file's own size. I did not examine very deep or very wide trees, so I did not check for amplification. It is **unverified**.
  • The 'Record.FindAll' and 'FullValue' implementations in the gedcom-go library — **unverified**. I did not read the vendored library, so I have not checked for pathological behavior on cyclic or huge inputs.
  • 'list.go:153-156': **unverified** whether the same '--with' path given twice is wanted. Text output prints two columns; JSON collapses them into one map key. Both stay within this file, so this is not a broken chain; it may be a question for The Skeptic.

@cacack

cacack commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

Unverified review dismissals

Review of #110 at 734668b (review before step 3's fixes). Lines a panel reviewer examined but could not clear — the boundary of the review, not findings and not clearance.

  • Stdin and argument handling ('readXRefs', 'minArgs(2)'): reused from 'get'. The tests cover "no xrefs on stdin", '-' given twice, and a missing xref argument. I did not read 'readXRefs' itself, so this is **unverified** beyond those tests.
  • 'living_test.go:167': the expected lines match what the 'living' fixture is claimed to contain. I did not read the fixture, so this is **unverified**.
  • 'internal/cli/refs.go:76-79' ('RemoveRecord' on the clone) — **unverified**: I did not read the library source to confirm that 'RemoveRecord' mutates only 'Records' and 'XRefMap'.
  • 'internal/cli/delete.go:20-28' ('line()' refactor) — same logic as the removed inline code. I did not run the 'delete' tests (**unverified**).
  • 'internal/cli/refs_test.go' exit-code table — 'ExitUsage' for '-' given twice and for a missing xref matches the 'readXRefs' and 'minArgs' conventions (**unverified**: I did not read 'readXRefs').
  • 'internal/cli/refs.go:39-49' ('readXRefs' on stdin) — **unverified**: did not check for a size limit on stdin.
  • 'internal/cli/refs.go:63' ('findRecords') — **unverified**: did not trace its lookup complexity.
  • 'refs.go:68-92' ('findPointers' shallow copy of '*doc' plus a cloned 'Records' and 'XRefMap') — **unverified**: I did not read the library's 'RemoveRecord' to confirm it mutates only 'Records' and 'XRefMap' and not other shared state. The dedup and ordering tests ('several' case) pass the repeated-x
  • 'internal/cli/refs.go:68-72' (shallow copy of 'doc' plus cloned 'Records' and 'XRefMap', then 'RemoveRecord'): this is memory-local and affects only the in-process document. Nothing is persisted. I did not trace whether 'RemoveRecord' mutates shared '*Record' children, so that part is **unverified**

@cacack

cacack commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

Unverified review dismissals

Review of #111 at ad24046 (review before step 3's fixes). Lines a panel reviewer examined but could not clear — the boundary of the review, not findings and not clearance.

  • 'internal/cli/media_add.go' ('addMedia' FORM fallback): the order is row.form, then 'defaultForm', then fallback. This adds no second pass over the rows, no nested loop and no I/O. 'defaultForm(doc, row.path)' is only reached when row.form is empty. I did not read 'defaultForm' itself, so any cost i
  • 'internal/cli/media_add.go:149-161' — 'readBatch(name, 2, 4, ...)' allows 2 to 4 fields, so the '>= 3' and '== 4' branches cover every case. **unverified**: I did not read 'readBatch' to confirm it rejects 5 or more fields and handles trailing tabs.
  • 'internal/cli/media_add.go' readMediaBatch ('readBatch(name, 2, 4, ...)', 'len(b.fields) >= 3' and '== 4') — the field-count bounds are enforced by 'readBatch' (2 to 4), so the 'fields[3]' index is safe. **unverified**: I did not read 'readBatch' itself, only its call site in the diff.
  • Test files — excluded from my read (':!*_test.go'). **unverified**.
  • 'media_add.go:202': **unverified**: a whitespace-only fourth column (for example '" "') is non-empty, gets written verbatim as FORM, and is not trimmed or validated. I did not check whether the gedcom-go encoder or 'validate' flags an empty or blank FORM.

@cacack
cacack merged commit a11c0e6 into main Nov 28, 2026
10 checks passed
@cacack
cacack deleted the milestone/open-issues branch November 28, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant