25 Commits
Author SHA1 Message Date
pnoker 372d75b0c9 refactor(core): rename find/query/fetch methods to get per crud law
sweep every module to satisfy the new method-name rule, renaming
about 40 methods together with their interface, implementation, test
and cli call sites: store find() lookups become get(), analytics
queryLatest/queryHistory become getLatest/getHistory, sql helper
query() becomes spec()/sql(), jwks fetch() becomes load(), and the
cursor record component queryDigest becomes requestDigest

no behavior changes; full unit suite (5278 tests) and both quality
gates stay green
2026-09-18 09:53:51 +08:00
pnoker 66aab58f20 build: standardize repository tooling and quality gates 2026-09-02 20:51:10 +08:00
pnoker a7ca489b9b style(repo): reformat java, xml, yaml, markdown and frontend sources 2026-08-25 21:27:49 +08:00
pnoker 769d1cb977 style: apply repository-wide formatting
- expand single-line Javadocs to multi-line blocks, rewrap Markdown prose, and reflow POM, YAML, and TypeScript formatting
- formatting only: no Java code lines changed, no build-file semantics changed
- verified: backend compile and check_documentation.py pass, pnpm check and pnpm lint:check pass, and the dc3 YAML files parse
2026-08-25 13:35:00 +08:00
pnoker 1fa2d6f0cf docs(comments): fill the real comment gaps across the repository
A comment-health audit driven by an AST scanner (regex scanners kept
false-positiving on annotation-separated javadoc; the AST pass with
constructor and @Override-implementation exemptions is what produced a
trustworthy worklist) ended with a much smaller true gap than the raw
numbers suggested: class-level javadoc is already at 100% repository-wide.

What actually gets filled here:

- AnalyticsModel: all 30 nested records of the S19 analytics facet get
  maintainer-voice javadoc (the @Schema descriptions serve the API side;
  these serve code readers).
- The whole entity/ext family (29 files, 47 nested classes): every
  Content/Ui/Validation/Security/AppliesTo/Template/Dedup/... schema
  class states what it actually holds — read from the fields, not
  templated.
- Adapter families: the @Bean methods of all six MQ adapters, all four
  TSDB adapters and the three DB dialect adapters get one-line
  maintainer docs (what binds to what, what is overridable).
- Nested support types across data/agentic/constant/public/facade:
  NotifyBindKey, CacheTuning, Credential, dashboard VOs' Item/BucketVO,
  ExpireListener (plus its null-doc placeholder javadoc replaced with a
  real contract), agentic chat/stream VOs' choice/delta/usage shapes,
  tool-context records, RequestHeader envelopes, FleetSummary,
  visualization Type/Scale codes.
- PointValueSampleConverter's boundary methods now state the port-side
  contract (quality default injection point, batch order preservation).

Comment drift fixed: the class javadoc of the can/mqtt/opc-da driver
skeletons claimed "see TODO markers in method bodies" — those markers
do not exist; the claims are corrected to plain work-in-progress notes.
The genuine TODOs (zigbee API verification, lwm2m lookup, ethernet-ip
CIP framing, CAN JNI) stay: they mark real unimplemented behavior.

Vendored-code boundary: the opc-da module carries a ported
org.openscada library (46 files, package org.openscada.*). Its trivial
accessors stay bare on purpose — filler comments on get/set pairs are
exactly the kind of noise this pass exists to remove — but the
non-obvious JIStruct wire-decoder methods (getStruct/fromStruct
FILETIME + three DO wrappers) now document the COM bridge shape.

Gates: full-repo compile green; data/model/constant/agentic/public
test suites green.
2026-08-24 21:23:39 +08:00
pnoker 95431e097f test(e2e): lock device-access mqtt vendor neutrality
Answer the broker-selection question for the device-access plane
mechanically: MQTT is an open wire protocol and the driver talks a
standard Paho client, so any conformant broker is a drop-in selection —
EMQX, Mosquitto, HiveMQ, NanoMQ, VerneMQ — via one URL
(dc3.driver.mqtt.url), no adapter layer needed.

MqttVendorNeutralityIT proves the property: the production option
builder (MqttUtil) plus the same client code performs a
publish/subscribe round trip against HiveMQ CE and Eclipse Mosquitto,
differing only in the broker URL. The compose default (dc3-emqx) is a
deployment choice; the guide's new device-access section documents the
URL-only selection, the no-vendor-code guardrail and the MQTT 3.1.1
dialect note (MQTT 5-only features belong to the internal-plane
adapter).

Full gated E2E now 26/26.
2026-08-20 11:26:24 +08:00
hongyuan.zhang 6b37cb5ccd docs(readme): refresh module documentation 2026-08-11 22:58:30 +08:00
pnoker 50c6de9438 docs: rewrap project guides and README files
Prose rewrapping and table reflow from a project-wide markdown pass;
no content changes. Also reverts two formatter mistakes: restores
MD5(password) in dc3-web/AGENTS.md and drops spurious spaces after
CJK punctuation in README.zh.md / README.ja.md.

Covers root guides (AGENTS/CONTRIBUTING/SECURITY/README.*), module
READMEs across dc3-api/center/common/driver/e2e/gateway, the nginx
guide, dc3/doc/{README,TITLE}.md, and dc3-web docs.
2026-08-09 18:44:55 +08:00
pnokerandClaude 2198d7fffe chore: merge iot-dc3-web frontend into monorepo
Merge the standalone iot-dc3-web repository into iot-dc3 as dc3-web/,
creating a single monorepo with unified versioning, CI/CD, and release
process.

- subtree-add iot-dc3-web under dc3-web/ with full commit history
- relocate nginx configs and SSL certs to dc3/dependencies/
- merge CI workflows (ci-backend.yml, ci-web.yml, docker-ci-web.yml)
- merge Issue/PR templates and dependabot config
- host frontend docs under docs/zh/frontend/
- share .husky/ hooks via root-level package.json (pnpm)
- unify versioning: single dc3/bin/tag.sh (vYYYY.M.P) for the whole repo
- update Dockerfile, docker-compose.yml, Makefile for new paths
- remove redundant directories from dc3-web/ (.claude, .github, dc3, docs, bin)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 14:43:22 +08:00
pnoker d18bf4d03d style: fix table alignment and whitespace in README files 2026-06-26 13:17:38 +08:00
pnoker 98f0ac3128 docs(readme): add READMEs for previously undocumented modules
Document 31 modules that had no README: dc3-center-agentic, dc3-e2e,
common modules (agentic, sql, test, resource-registrar) and the facade
subsystem (api/grpc/local-auth/local-data/local-manager), plus 21
drivers. Content is grounded in each module's pom/yaml/source; WIP
skeleton drivers (can, dlms, ethernet-ip, iec104, lwm2m, zigbee) are
flagged as such.
2026-06-22 16:50:08 +08:00
Vickey b3ee76f893 refactor(data): unify command history status/type/source to enum index
Align CommandHistory/PointCommandHistory with the EventHistory pattern:
DB stores the enum index (SMALLINT via @EnumValue), gRPC carries int32,
JSON keeps enum name. Removes the lone string-code outlier in the schema.

- DO status/type/source: String code -> enum types
- VO type/source: String -> enum (status already enum); JSON stays name
- Builder: drop ofCode @AfterMapping (DO and VO now share enum type)
- RabbitMQ DTOs (CommandCall/PointCommandResult): status/source -> enum
- driver sendResult signatures: String status -> PointCommandStatusEnum
- gRPC command_history.proto status/source: string -> int32; server uses
  getIndex()/ofIndex() to match EventHistoryServer
- tests updated to assert enum values
2026-06-09 18:05:40 +08:00
Vickey 918b3d5e8e feat: update pom version to 2026.5.22 2026-05-26 00:30:11 +08:00
Vickey a88cb03aa1 style: format DTO builders, E2E teardown and Javadoc alignment 2026-05-24 01:34:57 +08:00
Vickey 4aed1dcee5 style: remove unused imports 2026-05-24 01:34:51 +08:00
pnoker f0d0c7913c feat: add event alarm trigger, E2E contract tests, and docs
Add EVENT target type to AlarmTargetTypeFlagEnum, wire event report
into the alarm rule pipeline, add RabbitMQ contract E2E tests for
command call and event report, and create design documentation.
2026-05-23 19:16:01 +08:00
pnoker 5a3ab1440a test: improve backend test coverage governance 2026-05-19 18:19:12 +08:00
pnoker 7f5da1a0f8 chore: bump version to 2026.5.18 across all modules 2026-05-18 00:24:22 +08:00
pnoker 996518186a build: bump version to 2026.5.17
Update parent version and dc3.version from 2026.5.5 to 2026.5.17
across all Maven modules.
2026-05-17 19:01:44 +08:00
pnoker 019daf62ce feat: do someting test and code review 2026-05-16 00:56:04 +08:00
pnoker 74e16bfb30 style: format dc3-common, dc3-driver and dc3-e2e test code 2026-05-15 00:28:35 +08:00
pnoker 9123b480f4 test(e2e): stabilize infrastructure harness 2026-05-14 21:29:08 +08:00
Vickey 69090d1316 test(e2e): cover infrastructure contracts with rest-assured and direct clients
PostgresHypertableIT (2 tests):
  - timescaledb hypertable accepts batched inserts and returns expected aggregates
    (count / avg / min / max via simple SELECT) plus shows up in
    timescaledb_information.hypertables
  - hypertable enforces NOT NULL on the time column at insert time

RabbitDeliveryIT (6 tests):
  - publisher confirm round-trips for routed messages and queue depth = 1
  - mandatory=true unroutable messages return through the basic.return listener
  - manual ack drains the queue exactly once (unacked redelivered, acked stays drained)
  - waitForConfirms with no outstanding publishes completes synchronously
  - exclusive queue rejects a second consumer on the same connection
  - connection factory refuses invalid credentials on the fast path

RestAssuredHarnessIT (4 tests):
  - rest-assured can call a stub HTTP server and decode JSON envelopes (R.ok / R.fail)
  - request body and custom headers (X-DC3-Token) round-trip through assertions
  - RestAssuredConfig can force a JSON parser when the server omits Content-Type
  - response body can be extracted as a raw string for non-shape assertions

The full platform-image-driven user-flow scenarios (login, driver registration,
write point value, gateway 401, cross-tenant isolation, OFFLINE auto-status,
command round-trip, DLX requeue, agentic via WireMock, CSV import, token
rotation) will extend this harness once dc3-center-* and dc3-driver-* publish
immutable image tags suitable for CI. The infrastructure contracts pinned here
lock the assumptions those scenarios will rely on (timescale aggregation,
publisher confirms, rest-assured wiring).

@EnabledIfEnvironmentVariable(DC3_E2E) is now declared on each concrete IT
class because JUnit 5 evaluates the condition on the declared class only — the
abstract base BaseE2eIT comment now spells this out.

Run via DC3_E2E=true mvn -pl dc3-e2e -am verify.
2026-05-14 14:13:37 +08:00
Vickey c49dd630e3 test(e2e): bootstrap dockerized end-to-end harness
E2eStack: singleton Testcontainers-driven stack that starts
  - timescale/timescaledb-ha:pg18 (production-pinned), aliased dc3-postgres
  - rabbitmq:3.13-management, aliased dc3-rabbitmq
on a shared docker network with reuse enabled. start() is idempotent and
exposes JDBC URL / AMQP host:port / credentials / container references for
downstream E2E tests.

BaseE2eIT: shared base class with @BeforeAll bootStack() and
  @Tag("e2e") + @EnabledIfEnvironmentVariable(DC3_E2E=true|1|yes|on)
so non-E2E builds (no Docker, e.g. unit-test CI lanes) skip the suite by
default. Subclasses opt in by setting DC3_E2E.

HarnessSmokeIT (3 tests, gated):
  - postgres is reachable and accepts simple queries
  - rabbitmq is reachable and accepts the AMQP handshake
  - start() is idempotent across repeated calls (containers stay running)

build: declare postgresql, rabbitmq testcontainers + amqp-client + postgres JDBC
driver as test scope so the harness can reach the stack without leaking E2E
deps into deployable artifacts. Replaces the .gitkeep placeholder put in by
S0 with the real harness module.

Run via DC3_E2E=true mvn -pl dc3-e2e -am verify.
2026-05-14 13:49:59 +08:00
Vickey c47e5f0a37 test(infra): add coverage and end-to-end aggregator modules
Introduce two reactor modules that exist purely to host repository-wide
test concerns:

- dc3-coverage (packaging=pom) runs jacoco:report-aggregate against all
  contributing modules and applies a tree-wide jacoco:check rule. The
  aggregator excludes generated sources, deployable Application classes,
  POJO entity packages and the third-party modbus4j sero utilities so
  the percentage stays anchored on real business logic. Coverage gates
  start at 0% and tighten in later stages as more tests land.
- dc3-e2e (packaging=jar) reserves a place for the docker-compose driven
  end-to-end suite delivered in stage S8. Unit and integration phases
  are skipped by default and only the e2e profile turns them on.

Both modules are wired into the root reactor.
2026-05-13 13:02:26 +08:00