Skip to content

feat: Location-IP Extract Report — NetBox v4.4+ scope compatibility & expanded CSV columns#1

Merged
Champion2005 merged 9 commits intomainfrom
feat/location-ip-extract
Mar 3, 2026
Merged

feat: Location-IP Extract Report — NetBox v4.4+ scope compatibility & expanded CSV columns#1
Champion2005 merged 9 commits intomainfrom
feat/location-ip-extract

Conversation

@Champion2005
Copy link
Copy Markdown
Owner

Summary

Implements the Location-IP Extract Report feature (Phase 2 of the PRD) across 4 phases:

Phase 1 — Prefix Model Scope Fields

  • Added scope_type, scope_id, scope fields to the Prefix Pydantic model
  • Added resolved_site property: prefers scope (when scope_type == "dcim.site") over legacy site field
  • 5 new unit tests for all resolved_site scenarios

Phase 2 — CLI & Formatters Migration

  • Migrated all prefix.siteprefix.resolved_site (6 locations in cli.py, 5 in formatters.py)
  • Updated mock data to v4.4 scope shape across all test files
  • Added legacy site fallback test and scope formatter test

Phase 3 — Expanded CSV Columns

  • location-report CSV now emits 11 columns:
    • PRD columns: ip_range, building, province_state, city
    • General columns: prefix, site, region, facility, tenant, description, status
  • Added test_location_report_csv_has_prd_columns

Phase 4 — Documentation

  • README: NetBox 4.4+ badge, compatibility note, updated command table
  • docs/commands.md: Full location-report section with column documentation
  • CHANGELOG: Two new entries under [Unreleased]

Verification

  • 182/182 tests pass
  • mypy --strict clean (15 source files)
  • ruff format/lint clean

Closes no issue (PRD-driven feature work).

Aditya Patel and others added 9 commits March 3, 2026 14:07
- Fix tool-audit.log format: session ID moved to end, use [...] delimiters
  instead of '...' to eliminate confusing }' at line end
- Fix subagent.log format: session/agent IDs moved to end of log lines
- Fix session.log PreCompact format: session ID moved to end
- Trim session-start.sh: remove irrelevant Azure, Terraform, Node.js
  checks not applicable to a Python/uv CLI project
- Remove Azure delete block from pre-tool-safety.sh (not applicable)
- Trim copilot-instructions.md to essentials only (safety invariant,
  core rules, workflow principles) — reduces context loaded every request
- Add architecture.instructions.md with applyTo src/**/*.py — module
  layout, tech stack, commands table, build commands, branch naming now
  load only when editing source/test files
- Add applyTo frontmatter to cli, client, models, tests instruction
  files — each now loads only when the matched files are in context
- Add docs/workflow.md: full workflow reference covering prompts,
  subagents, skills, hooks, log formats, plan artifacts, CI/CD, and
  the daily dev cycle

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…inal ops, tailored hooks

Log paths moved from hooks/ to hooks/logs/:
  - All hook scripts updated (session-start, tool-logger, pre-compact,
    subagent-start, subagent-stop, session-stop)
  - session-stop.sh archives from logs/ to logs/archive/ on session end
  - Old tracked log files removed from git (session.log, tool-audit.log,
    subagent.log) — now gitignored under hooks/logs/ pattern
  - .gitignore: added hooks/logs/*.log entries + legacy path ignores

Tailored hooks for Python-only project (no Terraform, no Azure):
  - session-start.sh: removed Node.js, Terraform, Azure checks
  - pre-tool-safety.sh: removed terraform destroy + az delete blocks
    and Azure auth warning; kept catastrophic deny, force-push/main
    protection, and Python venv + GitHub auth warnings

Terminal ops delegated to subagents (execute removed from all prompts):
  - START, PLAN, BUILD, END, git-COMMIT, git-PUSH, git-PR, git-ISSUE,
    workflow-CUSTOMIZE, workflow-MIGRATE (10 prompts)
  - copilot-instructions.md: 'never runs terminal commands directly'

workflow-MIGRATE.prompt.md: carried over from template SOT

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…l commands

Synced from template SOT:
- writer.agent.md: added execute tool; handles file ops + uv/pytest/ruff/mypy
- copilot-instructions.md: explicit subagent routing table (writer for commands,
  reader read-only, github for git/gh)
- BUILD.prompt.md: Step 1 is now Write & Verify; writer briefing includes
  commands to run; single subagent call covers implementation + verification

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…te SOT

Bugs found during audit:
- subagent-start.sh: additionalContext was truncated to 1 rule — restored all 5
  (agent-initiated, read from disk, concise results, branch constraint,
  follow copilot-instructions.md)
- tool-logger.sh: field order mismatch (session= was after out=) — aligned
  to template format: | session= | in= | out=
- workflow-MIGRATE.prompt.md: stale copy missing template updates:
  explicit Azure/Terraform/Node.js removal steps in Step 6, and
  the hooks/logs/ path note in Rules

Expected differences confirmed (no changes needed):
- session-start.sh / pre-tool-safety.sh: intentionally tailored (Python+GitHub only)
- workflow-context.instructions.md: project-specific (nbpull description, layout, prompts table)
- BUILD.prompt.md: example commands use uv/mypy instead of terraform validate
- skill-finder/SKILL.md: azure/terraform/mcp-builder entries removed (not used here)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Champion2005 Champion2005 merged commit bb6f230 into main Mar 3, 2026
4 checks passed
@Champion2005 Champion2005 deleted the feat/location-ip-extract branch March 3, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant